在 Vim 内一次在单独的选项卡中打开多个文件(超过 10 个)

Open Many Files (Over 10) in Separate Tabs at Once in Vim

我注意到,当我尝试使用 -p 命令打开 vim 中的许多文件时,实际上只有大约 8 或 9 个打开。我可以更改它以使其更加开放吗?

来自 :help -p:

-p[N]    Open N tab pages.  If [N] is not given, one tab page is opened
         for every file given as argument.  The maximum is set with
         'tabpagemax' pages (default 10).  If there are more tab pages
         than arguments, the last few tab pages will be editing an
         empty file.  Also see |tabpage|.

所以在你的 .vimrc 中做例如set tabpagemax=99

备注

你说 'only about 8-9 of them actually open' 但事实并非如此:它是 只是他们没有在单独的标签页中打开。如果你这样做 :buffers (或 :files:ls) 你会看到所有文件都打开了,而且每一个 属于单独的'buffer'。掌握概念非常有用 缓冲区 vs 制表符 vs windows in vim,因为大多数其他编辑环境使用 标签页的方式与 vim 使用缓冲区的方式相同...

请参阅 :help 22.4:help windows 以及 :help tabpage 以了解它们是如何 相互关联。另请参阅此 博客 post 那 很好地列出了差异,这个堆栈 answer 进入更多 vim.

中有关缓冲区、windows 和制表符背后动机的详细信息

这是基本看懂的图:

Summary:
    A buffer is the in-memory text of a file.
    A window is a viewport on a buffer.
    A tab page is a collection of windows.

图片来自 here