Vim help when help is needed

Before I started writing this I thought “Vim’s got good help docs, people just tend to ignore them.” I should print them out and use them as a reference while writing this. Then I discovered there were 2,956 pages of them.

After spending a fair amount of time spelunking through :help for this site, I’ve finally begun to understand why people mostly ignore Vim’s thousands of pages of help. It’s because they’re not help docs, at least not in the traditional sense. They’re reference docs. They’re useful when you want to know exactly what a specific command does, but they’re terrible at helping you accomplish a task.

Googling for “How do I do x in vim” gets you an answer almost all the time. If you can’t find an answer there I’d recommend asking on the Vi and Vim Stack Exchange. There’s also a decent Vim wiki which pops up in the Google search results as often as Stack Overflow.

{{ aside }}

Note

Personally, I find searching Google for answers to vim questions to be a double-edged sword. I almost always find my answer, but I also tend to get sucked down rabbit holes of “ooh, I didn’t know you could do that too!” and “oh, that’s a cool thing”. 30 minutes later I remember that I’m supposed to be doing the stuff they actually pay me for. {{ /aside }}

What exactly does that command do?

Sometimes, you do want an explanation for what a specific command does. For example: take the i you type to enter insert mode. You can find out more about it by saying

:help i

There you’ll learn that it’s not only a trigger for switching to “insert” mode.

Insert text before the cursor [count] times. When using CTRL-O in Insert mode |i_CTRL-O| the count is not supported.

I’d been using Vim for a decade and never knew about that “[count] times” functionality applied to i, until I looked. Fortunately I knew enough to guess how to invoke it. I’ll cover how do do things like that later on, but I wanted you to have a feel for what’s in there, and know that even experienced geeks go in looking for help and wander away dissatisfied.

If you’re looking for info on a command you’ve found on the internet, use the help to learn more about it. If the internet has let you down, type :help with nothing after it, and do a search.

Split Window Help

Note that when you invoke help, it will split your window in half. The text you were editing is now in the bottom half, and the help doc is at the top. We’ll deal with how to manage splits later on. For now, you just need to know how to make the help go away when your done with it. The answer is you quit it.

:q

Just make sure your cursor is in the window you want to quit ;)

Where else to look

Obviously your first stop should be Google.