Skip to content

Instantly share code, notes, and snippets.

@namklabs
Created April 27, 2012 23:41
Show Gist options
  • Save namklabs/2514314 to your computer and use it in GitHub Desktop.
Save namklabs/2514314 to your computer and use it in GitHub Desktop.
To Many Upper Case Words? This will fix it
" Find All Words That Have A Capital Letter In Front. Replace with lower case letters.
" NOTE: I don't think this .vim file would actually work in vim. I just gave it that extension for Gist's sake.
:1s/\<\w*\>/\l&/gc
" : begin search and replace
" 1 line number you are searching
" s/ begin search
" \< match the beginning of a word
" \w match a letter
" * match any number of letters - 0 to infinite
" \> match the end of a word
" / end search, begin replace
" \l make the first letter of the matched word lowercase
" & print the matched word
" / end replace
" g match multiple instances per line
" c ask for action on each match
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment