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
:cprevbut we recommend the shortcuts provided by the vim-unimpaired plugin:
- This search is case sensitive unless
\cis appended to the search pattern. The shorted version
:helpgcan be used to save keystrokes. Example:
K -While reading help docs, press
Kon a word to jump to the docs for the word under the cursor. This is equivalent to running
:helpon 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
🚀 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!
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?