Replace text in VIM and keep the case
If you use the vim plugin vim-abolish you can replace some text keeping the original case. You just need to use S
instead of s
in find/replace vim command.
In order to change foo
to bar
and keep the case use:
:%S/foo/bar/gi
This will apply the following changes:
FOO => BAR
foo => bar
Foo => Bar
Tweet