News for hackers. Stuff that matters.
Re:Vim Recipes by visitor4rmindia on Wednesday May 20, 2009 @05:02AM (#618281)
Verbose and not worth the read IMHO. The best tip in this entire document was changing a sentence to title case.

>Select the text you want to convert, hit :, then enter the regex:

    s/\<\(\w\)\(\w*\)\>/\u\1\L\2/g. 
And, even this is not completely correct. The expression will not work if you select part of a line. Your best bet would be to remap the following:

  nnoremap <A-c> :s/\<\(\w\)\(\w*\)\>/\u\1\L\2/g<CR>
  vnoremap <A-c> :s/\%V\(\w\)\(\w*\)\%V/\u\1\L\2/g<CR>
To get key bindings that you like (I've defaulted to the EMacs capitalize-word binding).
Re:Vim Recipes by runpaint on Wednesday May 20, 2009 @05:10PM (#619327)
Thanks for the suggestion. I'll incorporate it into the recipe.