Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just used the help files in vim and now I am stuck in help.

:q Exits the entire program and I am getting tired of having to close and reopen vim every time I use help. I would prefer a command that can close help and return me to the program I am writing.

I have trouble searching google.com because the search string exit help in vim obviously returns articles about exiting vim itself, something I have became very good at.

Does anyone know how to do this?

EDIT: I must have been somehow getting stuck in the split screen thing. That's why I was unable to get out of the help via :q

share|improve this question

4 Answers 4

up vote 4 down vote accepted

:q is already the solution.

It closes not the whole vim session, but only the active window (split section within vim). If this is window is the help, only the help will be closed. If your document is active, the document will be closed.

If this is the last non-help window, the help will close as well -- which means vim is closed.

Use Ctrl+W followed by a cursor key to make sure your cursor is in the help window. Then try :q again.

share|improve this answer

You must have somehow arrived at a sole help window. Usually, :help splits a window, and a :q in that window will just close the help, and return to the other window.

Or, you've typed the :q while in the other window, not the help. Vim doesn't "count" help windows as full windows, and will quit completely when only help windows would be left.

There are quite some window management commands; for example, :close is a variant of :quit that won't exit Vim. Though initially confusing, learn how to use them, as they are very powerful. :help windows has all the information.

share|improve this answer

I use Ctrl+W+C or Ctrl+W+Q, although I agree that like many other more modern read only windows, it would be more natural if we could quit it with just pressing q.

share|improve this answer

Recent Vims have the :helpclose command (this needs a Vim 7.4.449)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.