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
emoves 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
wto jump to the beginning of the next word instead - Use
bto jump to the beginning of the previous word - Use
geto jump to the end of the previous word - Combine with operators:
dedeletes to the end of the word,cechanges to the end of the word - Use
3eto jump to the end of the third word ahead