当我在vim中使用:tabnew myfile
时,它将打开一个新选项卡。
当我退出标签时:q
,然后使用:bn
移至另一个选项卡,该选项卡仍然存在。
有人可以解释为什么以及如何真正关闭它吗?
最佳答案
您正在混用制表符和缓冲区。选项卡只是显示缓冲区的一种方式,关闭它对这些缓冲区没有任何作用。
如果要从缓冲区列表中删除缓冲区,请使用:bd
。从帮助中:
:[N]bd[elete][!] *:bd* *:bdel* *:bdelete* *E516*
:bd[elete][!] [N]
Unload buffer [N] (default: current buffer) and delete it from
the buffer list. If the buffer was changed, this fails,
unless when [!] is specified, in which case changes are lost.
The file remains unaffected. Any windows for this buffer are
closed. If buffer [N] is the current buffer, another buffer
will be displayed instead. This is the most recent entry in
the jump list that points into a loaded buffer.
Actually, the buffer isn't completely deleted, it is removed
from the buffer list |unlisted-buffer| and option values,
variables and mappings/abbreviations for the buffer are
cleared.
关于vim - 如何在vim中关闭标签页?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32714834/