Vim Basic Navigation — h, j, k, l and Word Motions
Master Vim's fundamental cursor movement keys: h, j, k, l for character movement and w, b, e for word-level navigation. The foundation of efficient Vim editing.
Detailed Explanation
The Home Row Navigation Keys
Vim's most distinctive feature is navigating without arrow keys. The four home row keys h, j, k, l keep your fingers on the home row for maximum typing speed.
Character-Level Movement
| Key | Direction | Mnemonic |
|---|---|---|
h |
Left | Leftmost key in the group |
j |
Down | "j" hangs below the baseline |
k |
Up | "k" reaches upward |
l |
Right | Rightmost key in the group |
Word-Level Movement
| Key | Action |
|---|---|
w |
Jump to the start of the next word |
b |
Jump back to the start of the current/previous word |
e |
Jump to the end of the current/next word |
W |
Jump to the next WORD (whitespace-delimited) |
B |
Jump back to the previous WORD |
E |
Jump to the end of the next WORD |
Practical Tip
The lowercase w, b, e treat punctuation as word boundaries. The uppercase W, B, E only use whitespace as boundaries, which is useful for navigating code with lots of symbols.
Combining with Counts
Prefix any motion with a number to repeat it:
5j— Move 5 lines down3w— Jump forward 3 words10l— Move 10 characters right
This count-motion pattern is fundamental to Vim's composability and works with virtually every motion command.
Use Case
You are getting started with Vim and need to learn the most essential movement commands to navigate files without relying on arrow keys or the mouse.