vimtricks.wiki Concise Vim tricks, one at a time.

How do I jump to the end of a word in Vim?

Answer

e

Explanation

The e command moves the cursor to the last character of the current word. If the cursor is already at the end of a word, it jumps to the end of the next word. It is one of Vim's fundamental word motions.

How it works

  • e moves forward to the end of the current or next word
  • A "word" is a sequence of letters, digits, and underscores, or a sequence of other non-blank characters
  • If the cursor is in the middle of a word, it moves to the last character of that word
  • If the cursor is already at the end of a word, it moves to the end of the next word

Example

Given the text with the cursor on the T:

The quick brown fox

Pressing e moves the cursor to e (end of The). Pressing e again moves to k (end of quick), then to n (end of brown), and so on.

Tips

  • Use E (uppercase) to move to the end of a WORD (whitespace-delimited, treating punctuation as part of the word)
  • Use w to jump to the beginning of the next word instead
  • Use b to jump to the beginning of the previous word
  • Use ge to jump to the end of the previous word
  • Combine with operators: de deletes to the end of the word, ce changes to the end of the word
  • Use 3e to jump to the end of the third word ahead

Next

How do I edit multiple lines at once using multiple cursors in Vim?