Wednesday, January 7, 2009

Command on All Windows

Here's a neat trick. If you want to execute an ex command on all windows, you can do the following:

:windo command

so...

:windo %s/foo/bar/g would find and replace foo with bar in all windows.

2 comments:

graywh said...

There's also :bufdo and :tabdo.

JuanPablo said...

a question,
how send a command output to new tab or new buffer ?

thanks.