Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

10/25/2019 cursor movement - How do I navigate to topics in Vim's documentation?

- Vi and Vim Stack Exchange

Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen
now

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.

Join this community

Anybody can ask a question

Anybody can answer

The best answers are voted


up and rise to the top

Vi and Vim Beta

How do I navigate to topics in Vim's documentation?


Asked 4 years, 8 months ago Active 1 year, 10 months ago Viewed 5k times

In Vim's built-in help system, how do I…

search for topics that I want help on?


94
follow hyperlinks?
browse around for related material?

cursor-movement help-system search tags


34

edited Feb 23 '15 at 20:17 asked Feb 23 '15 at 14:30


200_success romainl
5,107 1 29 58 26.8k 2 49 90

3 I never remember the keys for this from one time of using help to the next, but mercifully the help contents are
online. vimhelp.appspot.com – chicks Jun 8 '17 at 18:19

2ByAnswers
using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.

https://vi.stackexchange.com/questions/2136/how-do-i-navigate-to-topics-in-vims-documentation 1/5
10/25/2019 cursor movement - How do I navigate to topics in Vim's documentation? - Vi and Vim Stack Exchange

Vim comes with an exhaustive and fully indexed documentation that contains the answers to most
of the questions you may have on using Vim.
101 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…

1. The :help command is your gateway to Vim's documentation. Read the first screen now.

:help

Let's go meta:

:help help

2. You can complete the arguments with <Tab> and display the list of possible completions with
<C-d> .

:help buf<Tab>
:help :w<C-d>

By the way, here is an explanation of key notation:

:help key-notation

3. Most Ex commands can be shortened to a few characters. That's true for :help too:

:h

4. The :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

Note that a and A are both legitimate commands so case-insensitivity doesn't apply.
5. If you only have a generic keyword to search for, use :helpgrep and open the quickfix
window:

:helpgrep quickfix
:copen

6. Use <C-]> on the highlighted words to jump to the corresponding tag, use <C-t> to come
back.

See :help tags for more.


7. 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.
By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
8. Use the right syntax to search more efficiently:
Terms of Service.

https://vi.stackexchange.com/questions/2136/how-do-i-navigate-to-topics-in-vims-documentation 2/5
10/25/2019 cursor movement - How do I navigate to topics in Vim's documentation? - Vi and Vim Stack Exchange

: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'

Examples:

: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

9. Anatomy of a :help section:

:help ballooneval'

The words highlighted in red are the tags associated with that option.
The words in green are the long form and the short form of the option name.
The first line in white says that it's a boolean option and that it's off by default, see :help
options .

The second line in white says that the option is global, see :help option-summary .
The purple lines are self-explanatory.
Then comes the description of the option.
The turquoise words are "tags" that let you jump to another part of the documentation.
Don't be afraid to follow them.
10. 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?
11. RTFM is not an insult. You will learn a lot more by reading the documentation than by asking
short-sighted
By using our site, questions
you acknowledge to random
that you strangers
have read so make
and understand oursure youPolicy
Cookie at least triedPolicy
, Privacy to Read
, andTour
he
F antastic
Terms of Service.
M anual before asking.

https://vi.stackexchange.com/questions/2136/how-do-i-navigate-to-topics-in-vims-documentation 3/5
10/25/2019 cursor movement - How do I navigate to topics in Vim's documentation? - Vi and Vim Stack Exchange
edited Dec 26 '16 at 19:01 answered Feb 23 '15 at 14:30
romainl
26.8k 2 49 90

8 Good post :-) FYI, your screenshot is rather difficult to read on my screen due to poor contrast (especially the
red, and in a lesser degree the purple). – Martin Tournoij Feb 23 '15 at 16:42

8 I actually updated the help to include a similar list :h help-summary (needs a recent Vim) –
Christian Brabandt Mar 11 '16 at 7:05

1 > 4. The :help command and its tab-completion are case-insensitive < ← That's not precisely
true: E.g. :h a and :h A are distinguished. – Aaron Thoma Dec 26 '16 at 11:00

2 :helpgrep can be abbreviated to :helpg for more efficient everyday usage. – Aaron Thoma Dec 27 '16
at 16:41

-0.1 make notes about vim in a file. Use it as reference and container.

1. fast way to find vim help of key | :cmd | 'option' | etc


5
:h gi or :h g; for g i or g ; in normal mode
:h ^i for Ctrl - i in normal mode
:h ^w^w for Ctrl - w Ctrl - w in normal mode
:h ^wf for Ctrl - w f in normal mode
:h i^n for insert mode Ctrl - n

:h c^r^r for cmdline mode Ctrl - r Ctrl - r

:h :pu for ex-command :put


:h 'cb' for option clipboard .
:h `> for mark < .
:h @: for option repeat last ex command by eval register : (same mechanism as
macro).
type :h range , at this time you are in cmdline mode, then:
type Ctrl - a to complete all candidate that contain range
type Ctrl - f to popup a small edit window [Command Line]
type "*dd to cut it to system clipboard.
type o and Enter to cancel and exit window [Command Line]
h :range range() <range> [range] :func-range ... is excerpt
similarly, h mode-Ex mode-replace mode-cmdline mode-switching ... is excerpt for
mode- .

similar word that might be of interest: buf win tab line , etc.
By using our site, you acknowledge thatone
summary: this you shows
have read and understand
a way our Cookie
to find interesting Policy
items , Privacy
given Policy, and
a keyword withour
help of
Terms of Service. cmdline-completion .

https://vi.stackexchange.com/questions/2136/how-do-i-navigate-to-topics-in-vims-documentation 4/5
10/25/2019 cursor movement - How do I navigate to topics in Vim's documentation? - Vi and Vim Stack Exchange

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

answered Dec 2 '17 at 13:30


qeatzy
390 4 10

> define a buffer-local key-mapping to invoke vim help of word under cursor < You can also do setl
keywordprg=:help , then K already works – Mass Dec 2 '17 at 13:39

Yes, that's one of my settings, K for raw <cword> , the other one I use is <Space>k for <cWORD> with
post-precessing. ( <Space> is one of my leader key. Also, to be fluent, 'timeoutlen' being set) – qeatzy Dec 2
'17 at 13:50

By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.

https://vi.stackexchange.com/questions/2136/how-do-i-navigate-to-topics-in-vims-documentation 5/5

You might also like