The Vim help system is comprehensive. All core features and standard plugins are well documented. Most Vim plugin creators provide documentation as well. With so many features, I find the lesser used are often forgotten. Effective use of Vim’s help can improve the Vim experience greatly.
There are three features of Vim’s help which have (pardon the pun) helped me get the most from it.
It can be difficult to remember exactly the section I need to access, or exactly the name of a command I’ve forgotten how to use. Here’s how you can better navigate Vim’s help docs:
:helpgrep -
Search help docs for a pattern. Hits matching the expression are listed in the quickfix window. You can navigate forward and backward among the matches with:cnext
and:cprev
but we recommend the shortcuts provided by the vim-unimpaired plugin:]-q
and[-q
.This search is case sensitive unless
\c
is appended to the search pattern. The shorted version:helpg
can be used to save keystrokes. Example::helpg explore\c
K -
While reading help docs, pressK
on a word to jump to the docs for the word under the cursor. This is equivalent to running:help
on it. Because it’s a Vim jump, you can return to this spot with<C-o>
. And because they are jumps, you can navigate back among them. For more information on jumps, see our post about using jumps.<C-]>
- Jump to a tag under the cursor. Vim keeps a library of tags for any particular kind of content (usually programming languages, but in this case help content). If there is a tag for the word under the cursor, this will jump to that content. Because it’s a jump, it’s easy to navigate back.
The following screen capture shows the use of :helpgrep
, as well as demonstrating <C-]>
, and K
.
🚀 Some of the docs featured in this screencast are from Fugitive, the Git plugin for Vim. Our new email course, Git Better with Vim, is a deep-dive into Fugitive and several other plugins and configurations required to gain maximum efficiency with Git and Vim. We are delivering 24 lessons over 12 weeks. Join any time — the course always starts at the beginning. 🙏 Thanks to everyone for the great feedback on our course so far! Keep it coming: email us your thoughts!
Was this useful? Help us improve!
With your feedback, we can improve VimTricks. Click a link to vote: