In Vim's built-in help system, how do I…
- search for topics that I want help on?
- follow hyperlinks?
- browse around for related material?
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
In Vim's built-in help system, how do I…
Vim comes with an exhaustive and fully indexed documentation that contains the answers to most of the questions you may have on using Vim.
But the documentation is huge and may look to the neophyte as an impenetrable maze. Here are a few guidelines to help you find what you need…
:help command is your gateway to Vim's documentation. Read the first screen now.
Let's go meta:
You can complete the arguments with
<Tab> and display the list of possible completions with
:help buf<Tab> :help :w<C-d>
By the way, here is an explanation of key notation:
Most Ex commands can be shortened to a few characters. That's true for
:help command and its tab-completion are case-insensitive so the two commands below will get you to the same section:
:h BufWritePost :h bufwritepost
A are both legitimate commands so case-insensitivity doesn't apply.
If you only have a generic keyword to search for, use
:helpgrep and open the quickfix window:
:helpgrep quickfix :copen
<C-]> on the highlighted words to jump to the corresponding tag, use
<C-t> to come back.
:help tags for more.
Scroll around to see if there's a related option or command that better suits your needs. That's a great way to learn new tricks, too.
Use the right syntax to search more efficiently:
:h :command " help for ex-command 'command' :h 'option' " help for option 'option' :h function() " help for function 'function' :h modifier-key " help for 'modifier'-'key' in normal mode :h mode_modifier-key " help for 'modifier'-'key' in 'mode' :h mode_modifier-key_modifier-key " help for 'modifier'-'key' 'modifier'-'key' in 'mode'
:h :sort :h 'ai " only one quote needed :h bufnr( " no need for both parenthesis :h v_ctrl-g :h i_ctrl-x_ctrl-o :h ctrl-w " no mode required for normal mode
Anatomy of a
Use your brain, find logical patterns that will help you for future searches.
Once you have found the handy
:help list-functions, where to look for string-related functions?
Once you have found
:help i_ctrl-x_ctrl-o, how can you find help for
<C-x><C-l> in insert mode?
RTFM is not an insult. You will learn a lot more by reading the documentation than by asking short-sighted questions to random strangers so make sure you at least tried to Read The Fantastic Manual before asking.
:h help-summary(needs a recent Vim) Mar 11, 2016 at 7:05
4. The :help command and its tab-completion are case-insensitive< ← That's not precisely true: E.g.
:h Aare distinguished. Dec 26, 2016 at 11:00
:helpgrepcan be abbreviated to
:helpgfor more efficient everyday usage. Dec 27, 2016 at 16:41
:help help. You also have your answer in the first screen of
:help, which is point #1 of the answer.
-0.1 make notes about vim in a file. Use it as reference and container.
fast way to find vim help of
key | :cmd | 'option' | etc
:h g;for gi or g; in normal mode
:h ^ifor Ctrl-i in normal mode
:h ^w^wfor Ctrl-wCtrl-w in normal mode
:h ^wffor Ctrl-wf in normal mode
:h i^nfor insert mode Ctrl-n
:h c^r^rfor cmdline mode Ctrl-r Ctrl-r
:h :pufor ex-command
:h 'cb'for option
:h `>for mark
:h @:for option
repeat last ex command by eval register :(same mechanism as macro).
:h range, at this time you are in cmdline mode, then:
"*ddto cut it to system clipboard.
h :range range() <range> [range] :func-range ...is excerpt
h mode-Ex mode-replace mode-cmdline mode-switching ...is excerpt for
-0.2 define a buffer-local key-mapping to invoke vim help of word under cursor, when in previously mentioned vim notes file.
(and possibly with post-processing after extract
<cword>, in a vimscript function)
setl keywordprg=:help, then
<cword>, the other one I use is
<cWORD>with post-precessing. (
<Space>is one of my leader key. Also, to be fluent, 'timeoutlen' being set)
Regarding the question:
how to follow hyperlinks?
With the mouse cursor over the desired link do
t will bring you back to the initial outline with its list of links, where you can then jump to another section via hyperlink.
https://vim.fandom.com/wiki/Learn_to_use_help has a bunch of helpful information that's not accessible (if it's even present) in