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


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

:let @/ = ""

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


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

:1,10 s/search/replace/g 

All Lines All instances


[Originals source][src]
[Stack overflow vim clear question][clear] [src]: [clear]: