Vim: Search and replace in all buffers
:bufdo %s/pattern/substitution/ge | update
bufdo: applies the following command to all buffers.
%s: means search and replace the whole file
g: change all instances in a line
e: avoids the error when the pattern doesn’t exist in a file
update: writes the file only if changes were made
See also :argdo
Categories
Blogroll
Other
Sites
Now Reading
Planned books:
None
Current books:
-
Visual Masking: Time Slices through Conscious and Unconscious Vision (Oxford Psychology Series) by Bruno Breitmeyer
Recent books:
- The Scent of Desire: Discovering Our Enigmatic Sense of Smell by Rachel Herz
- Great Mythconceptions: The Science Behind the Myths by Karl Kruszelnicki
- Spook: Science Tackles the Afterlife by Mary Roach
- Lies My Teacher Told Me (Everything Your American History Textbook Got Wrong) by James W. Loewen
- Mona Lisa Overdrive by William Gibson
-

This is awesome. Would you mind me submitting this to VIM tips (crediting oyu site and linkign to the tip on this wiki page:
http://mark.foster.cc/wiki/index.php/Vim
Thanks Justin!
I created a new Vim Tip
http://vim.wikia.com/wiki/Search_and_Replace_All_Buffers
And linked it on the wiki page you mentioned.