How can I open several files using wildcards in a new tab for each file with VIM?
Similar to How can I open several files at once in Vim? but in new tabs instead of buffers.
How can I open several files using wildcards in a new tab for each file with VIM?
Similar to How can I open several files at once in Vim? but in new tabs instead of buffers.
Use the -p
flag:
vim -p *.c
The above will open all files matching *.c
.
You can also create an alias for this (I have alias vip='vim -p'
and I only type vip *.c
for the above example)
vim -p
in alias is very strange? Tabs are not for this. Can’t say for sure though: I did not downvote.
-p
in a vim alias is strange. Tabs are viewports, you don’t need as many viewports as you have buffers.
tabpagemax
option (10 is default).
If you are in Vim, this command will open each html file in the current directory in its own tab and restore syntax support (disabled by :argdo
):
:args *.html | argdo tabe | tabdo syntax on
If you are in your shell, go for the other answers.
If you want to open only .md.
vim -p *.md
Or after opening vim, use :args
to specify md files.
:args *.md
:tab all
args
way: If you do :tab sball
afterwards, the previously opened buffer will also be among the tabs.
Mar 26, 2014 at 22:36
To open files in new tabs without replacing the arguments or tabs that are already open:
:argadd *.c | tab all
Also, to search for files in subdirectories:
:argadd code/**/*.c | tab all