Step 5 of 6

3. Basic Navigation

Making bigger strides

Very rarely, when editing text, are you concerned with the individual characters. More often, you’re interested in the larger structure that those characters represent. It’s far more efficient to think in terms of words, sentences, and paragraphs instead of individual characters.

Luckily, Vim has commands that can help us here.

Words

In terms of words, Vim offers the following commands:

  • w for jumping forward by a word
  • b for jumping to the beginning of the current word (or the beginning of the next word if you’re already there)
  • e for jumping to the end of the current word (or the end of the next word if you’re already there)

WORDS

That’s not a typo. Vim makes a distinction between ‘words’ and ‘WORDS’. Without getting to deep into the details, a ‘word’ generally represents what you might think intuitively as a word. A ‘WORD’, on the other hand, is consists entirely of non-blank characters.

The motions for WORDS are just the uppercase of the word motions.

  • W for jumping forward by a word
  • B for jumping to the beginning of the current word (or the beginning of the next word if you’re already there)
  • E for jumping to the end of the current word (or the end of the next word if you’re already there)

Sentences

If you are a writer, you’ll surely find this handy. You can use ( and ) to jump forward and backward between sentences.

Paragraphs

You can use { and } to jump forward and backwards between paragraphs. This doesn’t just mean paragraphs of prose, though — it’s really useful for jumping around blocks of code if you’re a software engineer.

Work through the checklist below — then try W/B/E and the sentence motions ( and ) on the demo text while you’re there.

  1. Hop forward a word Press 3G to land on the practice line, then hop to the next word with w.
  2. Jump to the end of the word To move to the last character of the current word, press e.
  3. Hop back to the start of the word To move back to the word's beginning, press b.
  4. Leap across a paragraph The stop is the blank line after the first story paragraph — keep pressing } until you land on it.
Hop forward a word Press 3G to land on the practice line, then hop to the next word with w.

Next: Jump to the end of the word

Loading editor…