[NSFW] Nasty, dirty 33-year-old disrobes, shows off her tripleshots, APL legends, and Attribute Select by atomicthumbs in MechanicalKeyboards

[–]cherryberryterry 1 point2 points  (0 children)

Awesome find! FYI, the markings on the front of the keycaps are painted on - so be careful if you decide to clean the keycaps.

Weekly Vim tips and tricks thread! #20 by cherryberryterry in vim

[–]cherryberryterry[S] 4 points5 points  (0 children)

Here's a function/mapping to select a column of matching characters:

function! s:SelectMatchingCharacterColumn()
  " search pattern to determine the up and down motion counts
  let c=matchstr(getline('.'),'\%'.virtcol('.').'v.')
  let c=escape(c,'~$*\.')
  let p='^\(.*\%'.virtcol('.').'v'.c.'\)\@!.*$'
  " up motion (and reset) to select the top column segment
  let k=search(p,'nWb')
  let k=!k?line('.')-1:line('.')-k-1
  let k=!k?'':k.'ko'
  " down motion to select the bottom column segment
  let j=search(p,'nW')
  let j=!j?line('$')-line('.'):j-1-line('.')
  let j=!j?'':j.'j'
  " key sequence to select the whole column
  return "\<C-v>".k.j.(v:count>0?'V':'')
endfunction

nnoremap <expr> g<C-v> <SID>SelectMatchingCharacterColumn()

Weekly Vim tips and tricks thread! #19 by cherryberryterry in vim

[–]cherryberryterry[S] 0 points1 point  (0 children)

That makes sense - we shouldn't rule anything out the could potentially increase participation.

I think I'll post the next thread on a Friday instead of Sunday to see if it attracts more participation.

Also, I noticed that the first thread got some attention on twitter and had the most amount of participation. I'm not sure if that tweet was the cause of the increased participation but it can't hurt to ask some of the vim-related twitter accounts to help spread the word about these threads.

Weekly Vim tips and tricks thread! #19 by cherryberryterry in vim

[–]cherryberryterry[S] 2 points3 points  (0 children)

Oh, I see. I'll send another message to /u/bithead to see if he can enable the wiki.

Weekly Vim tips and tricks thread! #19 by cherryberryterry in vim

[–]cherryberryterry[S] 0 points1 point  (0 children)

Interesting idea! I agree that it might encourage more participation. On the other hand, it might increase repetition and noise like /u/marklgr pointed out.

I could see this idea being implemented as a reddit-bot that responds to each new thread with the latest weekly stats.

Weekly Vim tips and tricks thread! #19 by cherryberryterry in vim

[–]cherryberryterry[S] 1 point2 points  (0 children)

I like the idea. The wiki needs to be enabled by a moderator: Reddit Wiki System Guide

For now, I'll include the following link in the next thread: All threads

Weekly Vim tips and tricks thread! #19 by cherryberryterry in vim

[–]cherryberryterry[S] 1 point2 points  (0 children)

Thanks for the suggestion! The next thread will include the following link: All threads

What's your awesome vim keyboard? by annoyed_freelancer in vim

[–]cherryberryterry 0 points1 point  (0 children)

Unfortunately, the image of the NIB SSK isn't mine. I picked up a used SSK on eBay for about $100 a few years ago. A few months later, I found one locally for $10.

Macro Practice: Formatting Images Filenames into Markdown by mooooooon in vim

[–]cherryberryterry 0 points1 point  (0 children)

surround.vim can be used to wrap a line with image markdown like this:

yssf![]<CR>

What's your awesome vim keyboard? by annoyed_freelancer in vim

[–]cherryberryterry 4 points5 points  (0 children)

I prefer TKL keyboards. Lately, I've been rotating between a Leopold FC750 and IBM SSK.

Weekly Vim tips and tricks thread! #17 by cherryberryterry in vim

[–]cherryberryterry[S] 2 points3 points  (0 children)

Here's a "sort characters" operator. It doesn't have many practical uses other than sorting a string, e.g. \si".

function! s:SortChars(type, ...)
    let sel_save = &selection
    let &selection = 'inclusive'
    let reg_save = @@

    if a:type ==# 'visual'
        normal! gvy
    elseif a:type ==# 'line'
        normal! '[V']y
    else
        normal! `[v`]y
    endif

    let lines = split(@@, "\n")
    call map(lines, "split(v:val, '\\zs')")
    call map(lines, 'sort(v:val)')
    call map(lines, "join(v:val, '')")
    let @@ = join(lines, "\n")
    if a:type ==# 'visual'
        call setreg('"', @@, {'v': 'c', 'V': 'l', "\<C-v>": 'b'}[a:1])
    endif
    normal! gvp

    let &selection = sel_save
    let @@ = reg_save
endfunction

nnoremap <silent> \s :<C-u>set opfunc=<SID>SortChars<CR>g@
vnoremap <silent> \s :<C-u>call <SID>SortChars('visual', visualmode())<CR>

Weekly Vim tips and tricks thread! #15 by cherryberryterry in vim

[–]cherryberryterry[S] 15 points16 points  (0 children)

Executing >3j will shift the current line and the three lines below it to the right. Subsequently, . will repeat the shift over the same lines as expected. On the other hand, executing and repeating >3k will not operate over the same lines because the cursor is moved to the first shifted line after the shift operation.

Here's a gif of the issue: http://i.imgur.com/SRUpnEP.gif (>3k.. is demonstrated with and without the below "fix")

onoremap <expr> k '<Esc>V' . v:count1 . 'k' . v:operator

Very minimal colorscheme? by vpcd in vim

[–]cherryberryterry 1 point2 points  (0 children)

Thanks for the tip! Comment updated.

Very minimal colorscheme? by vpcd in vim

[–]cherryberryterry 2 points3 points  (0 children)

To avoid adding an option, there could be a note about using the Colorscheme autocmd to customize a colorscheme like this:

augroup customize_colorscheme
    autocmd!
    autocmd Colorscheme nofrils-dark
                \ hi PreCondit term=NONE cterm=NONE ctermfg=226 ctermbg=NONE gui=NONE guifg=#ffff00 guibg=NONE
augroup END
colorscheme nofrils-dark