Saturday, April 2, 2011

How to replace all the occurences of a string in a file in Vim?

/%s/old_string/new_string/gc

g = replace all, not only the 1st occurrence
c = ask for confirmation

Ref:
http://www.linux.com/learn/tutorials/8255-vim-tips-the-basics-of-search-and-replace

No comments: