Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vim

vimdiff

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.

like image 746
Rob Bednark Avatar asked Jan 17 '15 00:01

Rob Bednark


People also ask

How to close all splits vim?

Use :qa for "quit all".

How do I exit Vimdiff without saving?

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.


1 Answers

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

like image 179
Rob Bednark Avatar answered Sep 30 '22 18:09

Rob Bednark