Vim Scoops / Lessons / Move by word

How to move word by word in Vim

Press w to jump to the start of the next word, b to go back a word and e to jump to the end of a word. A count works too: 3w skips three words.

The keys

KeysWhat they do
wStart of the next word
bBack to the start of a word
eEnd of the word
W B ESame, but only spaces split words

To Vim, punctuation is its own word, so foo.bar is three words to w. The capital versions only stop at spaces, so they treat foo.bar as one.

Word motions also work after an operator: dw deletes to the next word and ce changes to the end of this one.

Related

Want all of Vim, in order? Vim Scoops is a free game that starts at h j k l and builds up to macros.

Play the full game