rthbound
rthbound

Reputation: 1343

Open more than 10 files matching a pattern with vim's CLI

Is there way (from the CLI) to increase the number of files that can be opened using vim's -p option?

E.g.

$ vim -p lib/**/*.rb # opens 10 files in tabs

Is there a way to alter the above command such that it will open all (or more than 10) files?

Alternatively, is there a better way to open the collection of files (in tabs) from the command line?

Upvotes: 5

Views: 2314

Answers (2)

rthbound
rthbound

Reputation: 1343

While you can increase the tabpagemax by

$ echo "set tabpagemax=30" >> ~/.vimrc

The better solution would be to use the same command without -p, opening all matching files in buffers:

$ vim lib/**/*.rb # opens all matching files in buffers

One can then navigate between files in vim's buffer using :bnext and :bprevious.

Upvotes: 1

Amit
Amit

Reputation: 20456

You can change this by setting the tabpagemax option in your .vimrc:

set tabpagemax=15

Upvotes: 10

Related Questions