Vim Tips Wiki
Advertisement

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-exitTonymec 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)

Yeah, I agree that someone needing this tip would probably not find it. Merging is OK, if it is to something more "discoverable", such as what Ben proposed. — Tonymec 05:19, August 17, 2010 (UTC)
When you read New to Vim it is clear that it follows a somewhat idiosyncratic style (it's part of Metacosm's move of material for the #vim IRC channel, from his website). I see the future of that page as being a very high-level overview, with links to actual content. For example, it mentions Ctrl-P/Ctrl-N completion but needs a link to some details. It should mention and link to pages on buffers/windows, and tags/cscope, and similar for other significant features. If we start padding it with actual content like details of how to save/quit, it will never be useful as an overview because the details will obscure the points. It should list most useful things so someone new to Vim would be able to find what main features exist.
I agree that Tutorial is already heavy with content, but details that flow in a linear fashion are easy to follow, so a section at the top on how to save/quit would be useful for anyone wanting it, and easily skipped by anyone who does not want it. Some redirects are a great idea. JohnBeckett 07:56, August 17, 2010 (UTC)
You've convinced me. I made a rough start. Please clean up as needed. --Fritzophrenic 14:20, August 17, 2010 (UTC)
Advertisement