[lug] Vim maps / vimrc files for html editing

Daniel Webb lists at danielwebb.us
Mon Feb 19 13:37:07 MST 2007


On Mon, Feb 19, 2007 at 12:33:30PM -0700, dio2002 at indra.com wrote:

> > find . -name '*.html' | xargs vim
> >
> > to start Vim with all the files you might want to find/replace, then
> >
> > :ed file.html
> >
> > to edit the particular file, then
> 
> what is 'ed' (i imagine edit file) and why do you need it?
>
> won't vim just load the first file passed to xargs and then proceed
> accordingly from file to file as you finish the last prompted substitution
> in each file automatically on its own?
 
Yes, I just meant that if you were interested in starting with a particular
file, you won't necessarily know which order 'find' is going to give to xargs,
so :ed file just goes to the one you're interested in.  You may not even need
to do that.
 
> > :argdo %s/from/to/gce
> 
> super thanks!

There's also :bufdo :windo and :tabdo depending on your editing style.  I
mostly use argdo.  I find it easiest to create a startup script similar to the
'find' command I gave above, then work on the whole project at once.  

I'm a big Vim fan.  I have a few video Vim demos on my web site, and the argdo
find/replace is one of them.  :)

http://danielwebb.us/software/vim_demo/



More information about the LUG mailing list