Vim Tips Wiki
Tip 265 Printable Monobook Previous Next

created 2002 · complexity basic · author Mikolaj Machowski · version 6.0

You can get fast access to read Vim's help by writing a small script. This can be particularly helpful if you have written your own documentation using Vim's help file type.

Suggestion 1[]

vim -c "help $1" -c only

Now name it, for example, vih and from the command line:

$ vih makeprg

Suggestion 2[]

Make an alias or shortcut to the command:

gvim -c ":h MyKeyWord" -c :only

This will open gvim, jump to your help text in help mode and close all the rest. You only see your help text, just what you wanted to read.

From 200904 tip (now removed)[]

Sometimes you may want to start Vim to look at a specific help page. I have these two functions in my ~/.bashrc for this purpose.

To open the help page for a given word from the command line:

  view -c "help $1" -c on -c "au! VimEnter *"

and the same with helpgrep (you need the command Vim, not view because of the quickfix window)

  vim -c "helpgrep $1" -c on -c copen -c "au! VimEnter *"

Now you can invoke the function with your search and Vim opens the desired help page. With the ;vimhelpgrep function it opens an additional quickfix window and goes to the first hit.


  • The two commands above include "au! VimEnter *" which removes all VimEnter autocommands.
  • That is probably to remove the effect of something in the author's vimrc, but is not required in general.
  • Think about whether to remove it, or perhaps replace with something like:
view -u '$VIMRUNTIME/vimrc_example.vim' -c "help $1" -c only

See also[]

These tips attempt to deal with making your own help text:

These tips relate to using vim -c: