tags:

views:

75

answers:

1

In a given working directory, if I do

:tabe **/test*.py

vim complains with E77: Too many file names. What if I want it to open every matching file in a separate tab? There must be a way to do it, but I can't find it.

+8  A: 

You could use the args list and argdo like so:

:args **/test*.py
:argdo tabe %

However, the syntax event is turned off by argdo (to speed up the normal use case), so the files will be loaded without syntax at first. You could follow it up with a :syntax on to force the syntax event on all loaded buffers. Compressed into one line (need to wrap argdo in execute so it doesn't absorb the following |):

:args **/test*.py | execute 'argdo tabe %' | syntax on

Alternately, you can open vim from the command line via:

vim -p **/test*.py

But that will max out at 10 tabs.

nicholas a. evans
thanks a lot!now, how could I make the pattern a parameter so I can map the script to a new command and I can do, e.g. `:tabeall **/test*.py`?
martin