Instead of typing :q for each open window, you can enter two commands:
- :only
- :q
or simply concatenate them at the command line for a one-liner:
- :on|q
Comments
What about a different one-liner? Three of them, actually, you can choose:
:qa!
to quit all without saving, or
:xa
to quit all and save anything 'modified', or
:qa
to quit all, except if there are 'modified' buffers?
See :help window-exit — Tonymec 23:22, August 14, 2010 (UTC)
Merge?
Nearly all the tips are written for a fairly advanced user. That has always struck me as a problem, particularly since many tips are poorly documented and require the reader to spend quite a long time working out what they are about (if you could quickly understand the tip, you probably would not need to read it). However, this proposed tip is rather too far in the other direction because it is an isolated fragment of information that would be hard to find by someone who needed it. Rather than putting this through our "new tips" procedure, I'm thinking that it might be best to quickly make a decision on this page. How about replacing this page with a redirect to Tutorial where I would make a new section like "Exiting Vim" with the information Tony outlined, with a tiny bit more? Please add any thoughts here. By the way, I will get back to fixing "new tips" when things have quietened down here. JohnBeckett 11:04, August 16, 2010 (UTC)
I agree whole-heartedly. In fact, I'd also create 3 more redirects to the same section: "Quit all windows", "Quit Vim", "Exit Vim". I was considering "Close all windows" as well but I imagine that's more likely to be a search term for closing all open windows leaving a single empty buffer in a still-running Vim, with something like :tabnew|tabon for a trivial solution.
Is there another Category:Getting started tip that would be better? Tutorial is OK I guess but is a bit information-overloaded. Perhaps New to Vim would be better, there is already some information about quitting at the top of the tip which could be expanded. Or maybe put the new quitting section at the top, if we do add it to Tutorial.
Maybe a quick mention of :qa in New to Vim with a more extended discussion in Tutorial would be the best approach.
--Fritzophrenic 17:12, August 16, 2010 (UTC)