Find and Replace in Vim

Back

Syntax:

:[range]s[ubstitute]/{pattern}/{string}/[flags] [count]

Example:

  • Replace all occurances of nimalan with mark :%s/nimalan/mark/g
  • Replace 4 occurances of a with o :%s/a/o/g 4