Take the 2-minute tour ×

I use buffers as "tabs" in Vim, and open new files using :e[dit] command. Why can't I use globbing with :e command?

:e some_dir/*
E77: Too many file names
share|improve this question
I’ve always wondered why you can’t even do this with :tab split... –  U2744 SNOWFLAKE Dec 25 '12 at 23:11
:e some_dir/* is ambiguous: Vim can edit a file or list the content of a directory. :e some_dir/*.js or :e some_dir/<tab> are perfectly fine, though. –  romainl Dec 25 '12 at 23:20
hm, :e some_dir/*.js gives me same E77: Too many file names –  Halst Dec 25 '12 at 23:45

3 Answers 3

up vote 2 down vote accepted

Just use :n instead:

:n some_dir/*
share|improve this answer

You can use globbing with :edit and other commands; however, there must be a single, unique result of the glob, because the :edit command only takes a single file. (How else should it display multiple matches in the single current window?)

If you want to edit multiple files sequentially, you can use :args or :argadd instead. Note that the :split command does not take multiple files, neither (probably because of the risk that many matches will inadvertently cause an impractically large number of window splits), but you could write your own :Split command that provides this functionality.

share|improve this answer

You should use :args or :argadd instead.

:args src/*
:tab all

First command loads all files from src/ folder to buffers and second command puts each buffer then into separate tabs.

:help arglist will give more information

share|improve this answer

Your Answer


