如果我打开了10个选项卡,我必须分别使用“:q”关闭每个选项卡。
我怎么能一下子把它们都关上呢?
如果我打开了10个选项卡,我必须分别使用“:q”关闭每个选项卡。
我怎么能一下子把它们都关上呢?
当前回答
最短/最简单/最快的方法是:
:qa
保存工作在所有标签和退出:
:wqa
其他回答
这可以用下面的方法来完成 命令(正常模式或escape模式下):
: tabdo:问
“tabdo”显然执行了 命令查看所有打开的选项卡。
我正在使用VSCode中的VIM插件,我正在寻找一种方法来关闭当前窗口上打开的所有选项卡。
命令:qa和:wqa不起作用,因为它们关闭了所有窗口中的所有选项卡。
tabonly命令关闭了当前窗口中除当前选项卡外的所有选项卡。
因为我通常只在同一时间使用2个窗口,我设法更接近我的需求是专注于另一个窗口并运行命令:
:on
(:only)关闭除当前窗口外的所有窗口。
:qall
这将关闭所有选项卡并打开缓冲区。
你可以使用这些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
我经常使用:tabo (:tabonly)来关闭所有其他选项卡。