Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1563771179
Fetching contributors…

Cannot retrieve contributors at this time

129 lines (105 sloc) 4.656 kb
<h3 id="help">Getting Help</h3>
<p>You want help with Vim but don't know where to look. Or, you've found help
but find the output of the online help confusing.</p>
<p>Look up a topic in the online help with <tt>:help <var>topic</var></tt>.
Search it with the <tt>:helpgrep <var>pattern</var></tt> command.</p>
<blockquote class="tip">
<p>When requesting help for a subject use
<kbd><kbd>&lt;Ctrl&gt;</kbd>+<kbd>d</kbd></kbd> to auto complete what you've
typed. For example, <tt>:help
:h<kbd><kbd>&lt;Ctrl&gt;</kbd>+<kbd>d</kbd></tt> shows a list of help
topics for commands starting with <tt>:h</tt>.</p>
<p>The <tt>:help <var>topic</var></tt> displays documentation for the <a
href="#navigating-tags">tag</a> named <var>topic</var> in the Vim
documentation. The tags are named
with the following convention:</p>
<tr><th>Type of Topic</th><th>Prepend</th><th>Example</th></tr>
<td>Normal mode command</td>
<td><tt>:help x</tt></td>
<td>Visual mode command</td>
<td><tt>:help v_u</tt></td>
<td>Insert mode command</td>
<td><tt>:help i_&lt;Esc&gt;</tt></td>
<td>Command-line command</td>
<td><tt>:help :quit</tt></td>
<td>Command-line editing</td>
<td><tt>:help c_&lt;Del&gt;</tt></td>
<td>Vim command argument</td>
<td>:help -r</td>
<td><tt>:help 'textwidth'</tt></td>
<p><small>(The table above is excerpted from the Vim online help).</small></p>
<p>The documentation itself also uses several conventions that may not be
immediately obvious. For example, <tt>:help help</tt> displays the
following<span class="fn">If you're using a different <a
href="#changing-colour-scheme">colour scheme</a> the
colours may be different.</span>:</p>
<img src="vim-help.png" width="639" height="209"
alt="Screenshot of a portion of the output for `:help help`">
<p>The strings in pink are synonymous tags for the current entry. For example,
<tt>:help &lt;F1&gt;</tt> locates the same entry as <tt>:help help</tt>.</p>
<p>The blue <tt>&lt;Help&gt;</tt> label indicates that in GVim the <i>Help</i>
menu is the GUI equivalent of this command.</p>
<p>The <tt>:h[elp]</tt> notation uses square brackets to indicate the optional
portion of the command. Command-line commands can be shortened to the point
that they are still unambiguous. In this case, <tt>:help</tt> can be shortened to
<tt>:h</tt> or <tt>:hel</tt>.</p>
<p>The green text (<tt>'helplang'</tt>) indicates an option. It's also a
hyperlink to an explanation of the option, so if your cursor is over it you
can use <kbd><kbd>&lt;Ctrl&gt;</kbd>+<kbd>]</kbd></kbd> to follow it.</p>
<img src="vim-help-helpgrep.png" width="627" height="153"
alt="Screenshot of a portion of the output for `:help :helpgrep`.">
<p>The screenshot above identifies some further conventions to be aware
<p>The <tt>{pattern}</tt> notation describes a variable, i.e. it's a placeholder
for text that you must supply.</p>
<p>Again square brackets are denote optional text. In this example,
<tt>[@xx]</tt> means that you can follow the pattern by a two-letter language
<p>Lastly, the light green text are also hyperlinks. For example,
<tt>:cwindow</tt> links to documentation for that command.</p>
<p><tt>helpgrep</tt> takes a pattern and matches it against the locally
installed documentation in much the same way as <tt>vimgrep</tt> did in <a
href="#searching-over-multiple-files">Searching Over Multiple Files</a>. If
it finds any matches, it adds them to the <i>quick fix list</i><span
class="fn">See the <i>Quick Fix List</i> sidebar in <a
href="#searching-over-multiple-files">Searching Over Multiple Files</a>
for more information</span>, and jumps to the first one.</p>
<blockquote class="tip">
<p>Once you've followed a hyperlink (with
<kbd><kbd>&lt;Ctrl&gt;</kbd>+<kbd>]</kbd></kbd>), you can return to your
previous location with <kbd><kbd>&lt;Ctrl&gt;</kbd>+<kbd>o</kbd></kbd>. This
works in a similar fashion to a web browser's <i>Back</i> button, so using
this key combination <var>n</var> times will take you to the place you were
at <var>n</var> links previously.</p>
<p>If you've installed a Vim addon, you'll need to run <tt>:helptags
<var>docs-path</var></tt> before <tt>helpgrep</tt> will see its
Jump to Line
Something went wrong with that request. Please try again.