Blog

How to become a Vim pro

Motions, operators and text objects for editing at the speed of thought

You've read How to become a Linux bash pro and your command line is lightning fast now. Time to fix the place where you spend the rest of your day: the editor. This site is called vimuser.com, so you can probably guess where this is going.

Fair warning: Vim has a reputation for being hard, and it's earned. But this learning curve pays rent. Put in a few focused hours and you'll edit text faster than you thought possible, for the rest of your life, on every machine you'll ever touch. And everything below applies to Vim and Neovim alike.

Basics

Getting out

Let's address the elephant in the room: millions of people have opened Vim and never found the exit. Here it is. Hit Esc, then type :q! to quit without saving, or :wq to write and quit. Or skip the colon entirely: ZZ saves and quits, ZQ quits and doesn't. You're free. Everything below is voluntary.

Do vimtutor

Vim ships with its own interactive tutorial. Type vimtutor into your terminal and give it thirty minutes. It teaches the mechanics; this post is about getting fast.

One thing at a time

Same rule as in the bash post: read about one thing, use it until it becomes second nature, then learn the next thing. Nobody remembers thirty motions after one read.

Normal mode is home

Here's the mental shift that makes Vim click: typing text is the exception. You spend most of your time in normal mode, where every key is a command. You drop into insert mode to type, hit Esc, and you're back home. If that sounds tedious, keep reading. The whole point of this post is what those command keys can do.

hjkl are the new arrow keys

Left, down, up, right: h, j, k, l. Right there on the home row, exactly where the bash post promised your fingers would end up.

Now the twist: if you press j ten times in a row, you're doing it wrong. Real movement happens with the motions below. Think of hjkl as fine-tuning.

w, b, e to jump by words

w jumps to the next word, b goes back one, and e lands on the end of a word. Motions take counts: 3w jumps three words at once.

0, ^ and $ for the start and end of the line

0 jumps to column zero, ^ to the first actual character of the line, and $ to the end. If you know regular expressions, the last two are old friends.

f and t to find characters

f plus any character finds its next occurrence on the line: fx lands on the next x. t stops just before it (think "till"). ; repeats the jump and , goes back. Once this is in your fingers, moving within a line feels like teleporting.

/ and * to search

/ searches the whole file: type a pattern, hit Return, then n for the next match and N for the previous one. Even better: * searches for the word under your cursor. No typing at all.

gg and G to jump through the file

gg takes you to the top of the file, G to the bottom, and 42G to line 42. For scrolling, Ctrl + D and Ctrl + U move half a page down and up.

Verbs + motions = the Vim language

This is where Vim stops being a pile of shortcuts and becomes a language. d deletes, c changes (delete, then drop into insert mode), y yanks (copies). On their own they do nothing; they wait for a motion. And you already know the motions:

  • dw deletes to the next word
  • d$ deletes to the end of the line
  • cfx changes everything up to and including the next x
  • yy yanks the whole line, p pastes it below

You don't memorize commands anymore. You compose them. This is the reason Vim users won't shut up about Vim.

Text objects: ciw, ci" and friends

Inside a command, i means "inside" and a means "around". ciw changes the word you're standing on, no matter where in the word your cursor is. ci" changes everything inside the quotes. da( deletes the parentheses and everything in them. dap deletes the whole paragraph.

If the last section was why Vim users won't shut up, text objects are why they get smug.

. repeats your last change

The humble dot repeats the last change you made. Search a word with *, change it with ciw, jump to the next match with n, hit ., and it's changed again. That's a one-key macro you get for free, and it's how pros make edits look effortless.

u = Undo

u undoes your last change, Ctrl + R redoes it. Vim keeps your entire undo history, so mash u without fear until the damage is gone.

Six doors into insert mode

i inserts before the cursor, a after it. Their big siblings I and A do the same at the beginning and end of the line. o opens a new line below, O one above. Don't enter insert mode and then travel: pick the door closest to your destination.

Esc is too far away

For a key you'll press hundreds of times a day, Escape lives in a terrible neighborhood. Ctrl + [ does exactly the same and keeps your hands where they belong.

Pro tip: Remap Caps Lock to Escape at the OS level, or map jk in insert mode to Escape. Your left pinky has been doing nothing for years. Time it earned its keep.

Where to go from here

If you want, you can give relative line numbers a try (:set relativenumber). Every line then shows its distance from the cursor, so jumps like 5j need no mental math. Some people swear by it. I'm not one of them, but you might be.

Resist installing twenty plugins in your first week. Plain Vim is already installed on every server you'll ever ssh into, and everything in this post works there too.

When that first week is over, treat yourself to Neovim, the modern fork of Vim and what I actually use. For the config, don't assemble it plugin by plugin: kickstart.nvim is a single, heavily commented file that sets up LSP, fuzzy finding and completion, and explains itself while you read it.

And no, I'm not going to tell you to run set -o vi, which puts Vim bindings on your shell prompt. Vim's modes pay off in a full file, where you navigate more than you type. A command line is a single line. Your cursor usually sits at the end of it, and the next keypress is Return. Switching modes there is overhead without the payoff. The default emacs-style bindings from the bash post work with no state to keep in your head, which makes them the better fit for one-liners. Vim in the editor, default bindings in the shell. Best tool for each job.

© 2026 Rudolf Unruh | unruh@vimuser.com