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?
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.
-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)