I have to type :q many times if I split window (or open file in a new tab) in vim to close every splited window( or tabs). Is there any way to exit vim just type one time :q and save all changes?
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.
To save and quit all. This is what you need.
:wqa
Note that the following will do the same thing because :xa
is a synonym for :wqa
. This is my favourite since it is shorter to type.
:xa
To quit all:
:qa
To not save (lose changes) and quit all:
:qa!
:qa
:wqa
Mnemonic: write quit all. You can access the docs like this from within Vim:
:help :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