search and replace vi


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



Copy this code and paste it in your HTML
  1. Vi: Search and Replace
  2. Change to normal mode with <ESC>.
  3. Search (Wraped around at end of file):
  4.  
  5. Search STRING forward : / STRING.
  6. Search STRING backward: ? STRING.
  7.  
  8. Repeat search: n
  9. Repeat search in opposite direction: N (SHIFT-n)
  10.  
  11. Replace: Same as with sed, Replace OLD with NEW:
  12.  
  13. First occurrence on current line: :s/OLD/NEW
  14.  
  15. Globally (all) on current line: :s/OLD/NEW/g
  16. Between two lines #,#: :#,#s/OLD/NEW/g
  17. Every occurrence in file: :%s/OLD/NEW/g

URL: http://www.felixgers.de/teaching/emacs/vi_search_replace.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.