Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
328 views
in Technique[技术] by (71.8m points)

What is the Vim command to quit all open windows?

:q only closes the current window. If you are using tabs or split windows, you need to do :q for all of them. Also, plugins like NERDTree and MiniBufExpl have their own windows, which need to be closed individually.

Is there a command to quit all these open windows and quit Vim in a single stroke? However, if there is some buffer or window with unsaved changes, I should be asked to save it or not. Any command to achieve this?

I hope this is not a strange request, because this is how most non-Vim editors with tab or splits work.

question from:https://stackoverflow.com/questions/14658600/what-is-the-vim-command-to-quit-all-open-windows

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can quit all loaded and open buffers, splits and tabs with:

:qa

If you want to quit without saving:

:qa!

You could assign a mapping to do this with a single stroke, this assigns the comma to quit everything without prompting to save:

nnoremap , :qa!<CR>

:wqall writes before closing, that might be useful.

Type :he :qa in vim for more info


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...