[lug] Little vim trick, editing multiple files

David L. Anselmi anselmi at anselmi.us
Wed Nov 30 21:55:06 MST 2005


Tkil wrote:
>>>>>>"Andrew" == Andrew Diederich <andrewdied at gmail.com> writes:
> 
> Andrew> I needed to edit a bunch of files, changing /old/path to
> Andrew> /new/path.  I knew there was a way to do it in vim, but
> Andrew> couldn't remember offhand.
> 
> I tend to reach for perl for this sort of thing:
> 
>   perl -i~ -pwe 's:/old/path:/new/path:g' files...

Yeah, me too.  It's very cool that vim can do that but I'd have to look 
it up frequently because I don't do that sort of thing often.  But the 
perl version uses things that I do all the time in perl.

Dave




More information about the LUG mailing list