can’t remember that stuff…

:%s/foo/bar/g
Find each occurrence of ‚foo‘ (in all lines), and replace it with ‚bar‘.
:s/foo/bar/g
Find each occurrence of ‚foo‘ (in the current line only), and replace it with ‚bar‘.
:%s/foo/bar/gc
Change each ‚foo‘ to ‚bar‘, but ask for confirmation first.

 

creditz: http://vim.wikia.com/wiki/Search_and_replace

admin