mlsamuelson.com

Search and Replace in Vim

:s/search/replace/
search only the current line and match and replace only the first occurrence of a term

:8,10 s/search/replace/g
search and replace all occurrences from line 8 to 10

:%s/search/replace/g
search and replace in whole document

:%s/search/replace/gc
same as previous but will ask for confirmation on replacements

Find Me Around

User login