3 ms·
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 :, t
by visitor4rmindia 17y ago
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).
- runpaint 17y agoThanks for the suggestion. I'll incorporate it into the recipe.