Search and replace in Vim


/ Published in: Other
Save to your folder(s)

Search and replacing all instances of some text within Vim


Copy this code and paste it in your HTML
  1. :%s/searchterm/replaceterm/g
  2.  
  3. eg.
  4.  
  5. Search for the word "today" within the whole file and replace all occurrences of it with "tomorrow".
  6.  
  7. :%s/today/tomorrow/g

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.