I want to open all the files from the current directory matching *.c.

I do it using

:args *.c
:tab all

However my vim opens the first nine files in new tabs and the last six in the last tab and splits them horizontally.

I've tried to use commands like :tabnew instead of :tab but they require a single file - I don't know how to solve my problem using those.

My questions are:

  • How can I quickly open many files the way every file has its own tab? Maybe it is possible to disable splitting?
  • Why does :tab behaves this way?

Multiple files in one tab

  • 1
    It looks like you are misusing tab pages. Use buffers instead.
    – romainl
    Jan 17, 2016 at 14:47
  • :h 'tabpagemax' Jul 17, 2016 at 5:16

1 Answer 1


Actually, there is a way to do it according to this answer:

:args *.c | argdo tabe

Works perfectly. It will probably close all your other tabs though. Click here if you want to learn more.

When it comes to the weird behaviour of :tab it turns out that there is a variable tabpagemax which is set to 10 by default (see :h tabepagemax). This explains everything.

You can find out what is the value of variables in vim using :set foo? where foo is the variable you are looking for.

Here are some references I've come by:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .