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.
Use :qa for "quit all".
Exit Vim Using a Shortcut Key In addition to command mode, Vim also has the option for shortcut keys: To save a file in Vim and exit, press Esc > Shift + ZZ. To exit Vim without saving, press Esc > Shift + ZX.
: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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With