How do I search across all of Vim's help documentation for a keyword or phrase?
Answer
:helpgrep {pattern}
Explanation
:helpgrep searches the full text of every Vim help file for a pattern and loads all matches into the quickfix list. It is indispensable when you know what a feature does but not what it is called in Vim's help system.
How it works
:helpgrep {pattern}— searches all help tags and text for the pattern (supports regex)- After running, the quickfix list is populated with every match
- Navigate results with
:cnext/:cprev(or]q/[qwith vim-unimpaired) :copenopens the quickfix window to see all matches at once- Each match opens the relevant help file in a split, ready to read
The pattern is a Vim regular expression, so :helpgrep fold\|foldmethod finds entries about either term.
Example
:helpgrep formatoptions
:copen
This lists every help section that mentions formatoptions, letting you quickly find the relevant :help fo-table entry without knowing the exact tag name.
Tips
- For a case-insensitive search, prefix with
\c::helpgrep \cspellsuggest :lhelpgrepworks the same way but loads results into the location list instead of the quickfix list, keeping them buffer-local- If you know the exact help tag,
:help {tag}is faster; use:helpgrepwhen you are exploring or the tag name is unknown - After opening a help topic, use
CTRL-]to follow a hyperlink to a related topic