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.
From Within Vim If you have already opened a file in vim editor, you can add more files to the vim session by entering :e followed by filename or path of the file to be opened. In this case also, vim will take you to the same interface that you get while opening multiple files from command line.
Opening a tab Probably the easiest to remember is to run the :tabnew command while in normal mode. This will open a new tab with an empty buffer. If you want to edit a file in the new tab, you can run :tabnew filename and Vim will load the file in the new tab.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With