如果我打开了10个选项卡,我必须分别使用“:q”关闭每个选项卡。
我怎么能一下子把它们都关上呢?
如果我打开了10个选项卡,我必须分别使用“:q”关闭每个选项卡。
我怎么能一下子把它们都关上呢?
当前回答
下面是关闭Linux/Mac上所有VIM实例的Dark Side方法
:!killall vim -9
不要使用它。它能满足你的要求,但可能不是最好的方式,但很有趣
其他回答
最短/最简单/最快的方法是:
:qa
保存工作在所有标签和退出:
:wqa
你可以使用这些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
这可以用下面的方法来完成 命令(正常模式或escape模式下):
: tabdo:问
“tabdo”显然执行了 命令查看所有打开的选项卡。
下面是关闭Linux/Mac上所有VIM实例的Dark Side方法
:!killall vim -9
不要使用它。它能满足你的要求,但可能不是最好的方式,但很有趣
fuentesjr补充说:
:qa!
将强制退出所有标签,如果你不关心保存。