How do I quit/exit all windows/buffers/splits/tabs at once in Vim or vimdiff?

VimVimdiff

Vim Problem Overview


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.

Vim Solutions


Solution 1 - Vim

: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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRob BednarkView Question on Stackoverflow
Solution 1 - VimRob BednarkView Answer on Stackoverflow