Guest User

Untitled

a guest
May 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Global replacement in a bunch of files in Vim:
  2.  
  3. :args *.[ch]
  4. :argdo %s/\<my_foo\>/My_Foo/ge | update
  5.  
  6. This changes the word "my_foo" to "My_Foo" in all *.c and *.h files. The "e"
  7. flag is used for the ":substitute" command to avoid an error for files where
  8. "my_foo" isn't used. ":update" writes the file only if changes were made.
  9.  
  10. *list-repeat*
  11. :bufdo[!] {cmd}
  12. :windo {cmd}
  13. :tabd[o] {cmd}
Add Comment
Please, Sign In to add comment