How to get vim to open multiple files into tabs at once
:tab all
will open all the files in Vim's argument list in individual tabs. The argument list is initially set to the list of file names given on the command line when Vim is started. The list may be changed with the :args
and related commands. See
:help :all
:help argument-list
Example:
:args *.c
:tab all
will open all the .c files in the current directory in individual tabs.
You actually can open new tabs and keep your current tabs without writing new functions. See this answer on Stack Overflow: https://stackoverflow.com/a/11430615/200234
:args file1 file2 | argdo tabe
You may want to open a new empty tab (:tabe
) before doing that, because the first file will open in the current tab. Also, an extra empty tab will be left open (see :help argdo
to understand why).