RockPaperScissors

LizardSpock

Vim Search and Replace

| Comments

To search in Vim just press (apple-f for macvim) / then search string.

/search

This will highlight all occurrences of ‘search’, to clear the highlighting enter:

:let @/ = ""

To search and replace the first occurrence on this line only:

:s/search/replace/

Lines 1 to 10 all instance per line (thats the /g global):

:1,10 s/search/replace/g 

All Lines All instances

:%s/search/replace/g 

Originals source
Stack overflow vim clear question

Comments