# Wednesday, July 05, 2006

I ♥ vim

Example:
:args *.[ch]
:argdo %s/\<my_foo\>/My_Foo/ge | update
This changes the word "my_foo" to "My_Foo" in all *.c and *.h files.  The "e"
flag is used for the ":substitute" command to avoid an error for files where
"my_foo" isn't used.  ":update" writes the file only if changes were made.

[ Vim documentation: editing ]

This one item is the timesaver that is my "killer app" for using vim above all other editors. If you combine this with searching in windows for all *.html files (or some such) and then right-click and "edit in single vim" you can set up the args to be all the files in a webroot or somesuch. Perhaps for changing links everywhere.

#    Comments [0] |
Comments are closed.