regex - How to find and replace upper and lowercase and keep capitalization in Vim -


this question has answer here:

let's have:

foo , foo 

how can find , replace to

bar , bar 

with 1 regex/find , replace command in vim? default have vim setup find either uppercase , lowercase when searching. want replace keeping capitalization. possible?

i recommend tim pope's abolish plugin. provides :subvert or :s command short ask.

:%s/foo/bar/g 

drew neil on @ vimcast has nice screencast, supercharged substitution :subvert.


Comments