如果我打开了10个选项卡,我必须分别使用“:q”关闭每个选项卡。

我怎么能一下子把它们都关上呢?


当前回答

我经常使用:tabo (:tabonly)来关闭所有其他选项卡。

其他回答

你可以使用这些Vim Ex命令来退出多个窗口和缓冲区:

:qa :qall Exit Vim, unless there are some buffers which have been changed. (Use :bmod to go to the next modified buffer). When 'autowriteall' is set all changed buffers will be written, like :wqall. :conf qa :confirm qall Exit Vim. Bring up a prompt when some buffers have been changed. See :confirm. :qa! :qall! Exit Vim. Any changes to buffers are lost. Also see :cquit, it does the same but exits with a non-zero value. :quita :quitall :quita! :quitall! Same as :qall. :wqa :wqall :xa :xall Write all changed buffers and exit Vim. If there are buffers without a file name, which are readonly or which cannot be written for another reason, Vim will not quit. :conf wqa :confirm wqall :conf xa :confirm xall Write all changed buffers and exit Vim. Bring up a prompt when some buffers are readonly or cannot be written for another reason. See :confirm. :wqa! :xa! :wqall! :xall! Write all changed buffers, even the ones that are readonly, and exit Vim. If there are buffers without a file name or which cannot be written for another reason, Vim will not quit.

要在Vim中阅读这些内容,请键入以下Ex命令

:help window-exit

下面是关闭Linux/Mac上所有VIM实例的Dark Side方法

:!killall vim -9

不要使用它。它能满足你的要求,但可能不是最好的方式,但很有趣

我正在使用VSCode中的VIM插件,我正在寻找一种方法来关闭当前窗口上打开的所有选项卡。

命令:qa和:wqa不起作用,因为它们关闭了所有窗口中的所有选项卡。

tabonly命令关闭了当前窗口中除当前选项卡外的所有选项卡。

因为我通常只在同一时间使用2个窗口,我设法更接近我的需求是专注于另一个窗口并运行命令:

:on

(:only)关闭除当前窗口外的所有窗口。

我经常使用:tabo (:tabonly)来关闭所有其他选项卡。

fuentesjr补充说:

:qa!

将强制退出所有标签,如果你不关心保存。