How to exit help in vim
: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.
Recent Vims have the :helpclose
command (this needs a Vim 7.4.449)
:q
is a little bit annoying since this is a readonly buffer. And I believe people rarely need to record a macro in help buffer.
So I'd like to map q
to :q
:
autocmd FileType help noremap <buffer> q :q<cr>
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.