47

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?

4 Answers 4

67

Use :qa for "quit all".

If you have unsaved buffers you'll have to add a bang: :qa!.

1
  • 1
    anyway to quite all splits but without quitting tabs?
    – Quang Van
    Sep 23, 2017 at 0:59
14

If you want to save all the splits as well type :wqa

5

If I understand correctly, :qall is what you want.

2

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.

2
  • For some reason I never hopped on the 'ZZ' bandwagon, but I threw your mappings in my .vimrc to test drive them (fewer keystrokes after all).
    – cdated
    Dec 13, 2010 at 20:19
  • Thanks for the heads up on qbuf, this ended up being pretty interesting. I noticed it doesn't have the option to put the buffer in a vertical split so I added this line \"v": "vertical sb #" in my copy, and let the maintainer know.
    – cdated
    Dec 13, 2010 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.