[plug] Vim batch command

James Devenish devenish at guild.uwa.edu.au
Sun Sep 26 10:34:54 WST 2004


In message <41560F76.9070602 at westnet.com.au>
on Sun, Sep 26, 2004 at 08:38:14AM +0800, Garry wrote:
> Can't find any clues in the vim docs, and I haven't worked out sed to
> use on [its] own on files yet..

In addition to Perl solutions, recent versions of GNU sed offer an -i
option for this purpose. Regarding vim, my understanding is that you
would feed filenames to it individually, like this:

find . -name \*.html | xargs -n1 ex "+%s/bgcolor='white'/bgcolor='#00cc00'/" +wq

If you were doing it interactively, you'd record a macro for this
purpose.





More information about the plug mailing list