我注意到,当我尝试使用 -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|.
Run Code Online (Sandbox Code Playgroud)
所以在你的 .vimrc 中做例如set tabpagemax=99
您说“只有大约 8-9 个真正打开”,但这不是真的:只是它们没有在单独的选项卡页面中打开。如果您这样做:buffers(或
:files或:ls),您将看到所有打开的文档,并且每个文档都属于一个单独的“缓冲区”。掌握 vim 中缓冲区、选项卡和窗口的概念非常有用,因为大多数其他编辑环境使用选项卡页的方式与 vim 使用缓冲区的方式相同...
查看:help 22.4和:help windows并:help tabpage理清它们之间的关系。另请参阅这篇博客文章,其中很好地列出了差异,以及此堆栈答案,其中详细介绍了 vim 中缓冲区、窗口和选项卡背后的动机。
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.
Run Code Online (Sandbox Code Playgroud)
图片取自这里