CodeRigor

FREE LESSON

Vim words: w b e, W B E, 0 ^ $

Move by words and WORDs instead of characters, and jump to line starts and ends.

Characters are too small a unit. Vim's word motions:

Key Moves to
w start of the next word
b start of the current/previous word "back"
e end of the word
W B E the same for WORDs
0 column 0
^ first non-blank character
$ last character

A word is a run of letters, digits and _, or a run of other punctuation — so a->b is three words (a, ->, b). A WORD is anything between whitespace, so a->b is one WORD. In C++, W/E are great for skipping over std::vector<int> or obj->field.

words vs WORDs in x = obj->field;
start / 6
A word is a run of letters/digits/_ or a run of punctuation, so obj->field is three words; a WORD is everything between spaces. Step through w presses.
words vs WORDs in x = obj->field;
A word is a run of letters/digits/_ or a run of punctuation, so obj->field is three words; a WORD is everything between spaces. Step through w presses.

A is $a and I is ^i — the most common pairs get one key.

Watch & read

Free lectures, talks and readings that cover this skill from another angle. All resources →

ThePrimeagen's motions series: moving efficiently beyond hjkl.