Close all viewports (split screens) in Vim at once
When I use Vim I tend to split my screen in various ways, but when I want to close the editor I have to close each split separately. Is there a way to close all the splits at one regardless of how many splits I have open?
Use :qa
for "quit all".
If you have unsaved buffers you'll have to add a bang: :qa!
.
If you want to save all the splits as well type :wqa
If I understand correctly, :qall
is what you want.
It has already been mentioned that :qa
is what you want.
Because I (used to)* want this so often, I have added these to my .vimrc
:
" missing ZZ and ZQ counterparts:
" quick save-buffer and quit-everything
nnoremap ZS :w<CR>
nnoremap ZX :qa<CR>
* I don’t work much with splits any more since I found the qbuf plugin.