Barbarian Meets Coding
barbarianmeetscoding

WebDev, UX & a Pinch of Fantasy

4 minutes readfive-minutes-vim

5 Minutes Vim: Learn to Use Vim's Help

5 minutes vim. Learn cool stuff about vim in under 5 minutes
In this 5 minutes of Vim goodness you learn how to use Vim help to learn more about Vim, solve issues and become more effective

In this 5 minutes of Vim goodness we’ll learn about one of the most amazing yet often underused features in Vim and how you can use it to become more effective with Vim. Vim’s Help! Here we go!

Vim’s help is truly amazing and unique. If whenever you use Vim you run into a problem, or wonder how to do something, or how something works, try typing :h {keyword} and Vim will do its best to fulfill your wishes and find the help you need. The {keyword} itself can be a command, a key combination or just something that you want to learn more about:

  • Want to know how the :global command works? Then try :h :global.
  • Want to know what the daw key combo does? Test :h daw.
  • Want to know about motions in Vim? Then try :h motions.
  • Want to know what the wildmenu option does in the vimrc? Type :h 'wildmenu'.
  • Want to learn how to quit Vim? Yes. You guessed it. Go :h quit
  • Want to learn what CTRL-W does in insert mode? Try :h i_CTRL-W

Become More Effective Using Vim’s Help

Type :h or :help and you’ll be taken to the help’s index which starts with information about how to use the help itself:

Vim's awesome help

How shall I help you, oh master?

This initial help document contains a quickstart guide with a couple of nice tricks that will allow you navigate Vim’s help faster:

  • Type <C-]> to follow a link (you can differentiate links from regular text because links are highlighted)
  • Use <C-O> to go back to where you were before
  • Use /{pattern} to search within a document (that’s how you normally search for things in Vim by the way).
  • The help appears in a normal split window so when you’re done with it you can just close it with the :quit command just like any other window
  • Skim :h help-summary and :h helphelp at least once to get a feel for all the things that you can search for in Vim and how to do it.

Read the Help like a Book

Vim’s help is great for precision lightning attacks of curiosity and/or need, like the ones above, but it is also great to peruse and read like a book.

When you type help, right below the quickstart introductory guide, you have the Vim user and reference manuals. The user manual is essentially a book on how to use Vim, from novice to expert with topics ranging from how to move around in Vim to how to create your own syntax highlighters. The reference manual is an in-depth reference of everything Vim. Both of them are really great.

Get Help with Vim Plugins

One thing that is really cool is that Vim’s third party plugins also appear in the help. Just installed a popular plugin and don’t quite know how it works? Try :h {nameOfPlugin}. If you are unsure about the name of the plugin’s docs, then take a look at the bottom of the :help page where you’ll find the third party plugins listed:

Vim's awesome help includes plugins

The type of information that is really useful to look out for is:

  • What does it do?
  • How do you set it up? Does it work out of the box or does it require some additional setup?
  • What are the commands and mappings that it adds to your Vim setup? How can you customize them?

A small warning here: With Vim plugins you will often find that the help you can find inside Vim is far superior to whatever you can find outside (like searching the web). So it is very important to get into the habit of using help, even for plugins, specially for plugins.

Awesome! That’s it! Hope you found this article useful. Take care!


Jaime González García

Written by Jaime González García , dad, husband, software engineer, ux designer, amateur pixel artist, tinkerer and master of the arcane arts. You can also find him on Twitter jabbering about random stuff.Jaime González García