Open several files in new tabs with VIM

2020-05-30 04:04发布

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.

标签: vim
5条回答
家丑人穷心不美
2楼-- · 2020-05-30 04:17

If you want to open only .md.

vim -p *.md

Or after opening vim, use :args to specify md files.

:args *.md
:tab all
查看更多
Ridiculous、
3楼-- · 2020-05-30 04:18

with the p option: vim -p file1.cc file2.cc file3.cc

查看更多
该账号已被封号
4楼-- · 2020-05-30 04:32

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)

查看更多
The star\"
5楼-- · 2020-05-30 04:33

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.

查看更多
一纸荒年 Trace。
6楼-- · 2020-05-30 04: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
查看更多
登录 后发表回答