Reputation: 1369
I have a file in which I wrote many time the same word in upper case. I wanna modify all the words at once from upper to lower case, except those coming after a dot. Is that possible? I've found some tips here and there, but in all of them it is needed to place the cursor at the begging of the word.
Upvotes: 2
Views: 167
Reputation: 76
:1,$s/\([^\.]\s\s*\)MYWORD/\1myword/g
This will replace all MYWORD with myword unless it follows a . and one or more spaces. This will not change MYWORD at the beginning of line. For those, you can run the following again:
:1,$s/^MYWORD/myword/
Upvotes: 1
Reputation: 2572
:%s/.*/\L&/g
Of course it must be proper regular expression. This one takes all(.*), the rest is up to you.
Details here: http://vim.wikia.com/wiki/Changing_case_with_regular_expressions
Upvotes: 3
Reputation: 57470
:%s/\.\@<!\<THEWORD\>/theword/g
Replace "THEWORD
" and "theword
" with the properly-cased equivalents of the actual word in question.
Upvotes: 5