How do I jump to the beginning of the next word?
Answer
w
Explanation
The w command moves the cursor forward to the beginning of the next word. It is one of Vim's most fundamental motions and is used constantly for navigating within a line.
How it works
wjumps to the start of the next word- A "word" in Vim consists of 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,
wskips to the beginning of the next word
Example
Given the text with the cursor on the T:
The quick brown fox
Pressing w three times moves the cursor: T → q → b → f, landing on the first character of each subsequent word.
Tips
- Use
bto move backward to the beginning of the previous word - Use
eto move to the end of the current or next word - Use
W(uppercase) to move by WORD — whitespace-delimited chunks that treat punctuation as part of the word (e.g.,foo.baris one WORD but two words) - Combine with operators:
dwdeletes to the start of the next word,cwchanges to the end of the current word,ywyanks to the start of the next word - Use
3wto jump forward three words at once - Use
2dword2wto delete two words