62

How do you quit all windows with a single command in Vim or vimdiff?

:q only quits out of the active window, so then a separate :q is needed to close each window.

1
  • 2
    Here's what I like to do - :only to show the final result of the merge, then ZZ to save and quit, since there is only one window open after :only command (or swap ZZ for however you like to quit a single window). Commented Jan 25, 2016 at 17:12

1 Answer 1

107

:qa quits all open windows/buffers/splits/tabs
(aliases: :qall :quitall)

Vim documentation for :qa

For help on this command in Vim: :help :qa

:qa! will quit without giving an option to save if it's modified.
:wqa will write all changed buffers and then quit.
:wqa! will write all changed buffers, even readonly ones, and then quit.

Sign up to request clarification or add additional context in comments.

1 Comment

For those who don't know where to write :qa, first press ctrl+C.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.