:[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.
4条答案
按热度按时间vlju58qv1#
您可以使用
:tabclose
(缩短的别名也适用于:tabc
)。阅读更多关于
:help tabpage
的信息。至于用
:bn
返回的缓冲区,我相信这对“隐藏缓冲区”来说是正常的,当你经过最后一个缓冲区时,:bn
会绕到第一个缓冲区。请参阅
:help buffer-hidden
eivgtgni2#
你把标签和缓冲区弄混了。标签只是显示缓冲区的一种方式,关闭它不会对它们做任何事情。
如果要从缓冲区列表中删除缓冲区,请使用
:bd
。在帮助中:sqougxex3#
:tabclose
将需要与:tabN
而不是:bn
耦合。正如最初的答案所暗示的,制表符和缓冲区不是同一个概念。如果使用制表符,使用正确的命令将有所帮助。2admgd594#
如果您使用的是common vim:
:bd
如果您使用的是SpaceVim之类的软件:
SPC+b+d
将删除当前缓冲区。