Mastering Vim Motions
A practical guide to moving efficiently in Vim and Neovim.
Table of Contents
Vim motions are the secret to editing at the speed of thought. Once they click, you’ll never go back.
What Are Vim Motions?
Vim motions are commands that move the cursor. Instead of arrow keys or mouse clicks, you use keyboard shortcuts to navigate precisely.
The Basic Movements
Character Movement
h " Left
j " Down
k " Up
l " Right
These feel slow at first, but they keep your fingers on the home row.
Word Movement
w " Next word start
b " Previous word start
e " Next word end
Now you’re thinking in words, not characters.
Line Movement
0 " Start of line
^ " First non-blank character
$ " End of line
The Power of Combining
Vim motions become powerful when combined with operators:
dw " Delete word
d$ " Delete to end of line
ciw " Change inner word
ya" " Yank around quotes
The pattern: Operator + Motion = Action
My Favorite Motions
Search and Jump
f{char} " Jump to character
; " Repeat f-motion
/pattern " Search forward
n " Next match
Marks and Jumps
m{a-z} " Set mark
'{a-z} " Jump to mark
'' " Jump back
Practice Tips
- Start with one motion per day - Don’t overwhelm yourself
- Use vimtutor - Run
vimtutorin your terminal - Disable arrow keys - Force yourself to use motions
- Track your progress - Keep notes on what you learn
The Realization
After a few weeks, something clicks. You stop thinking about how to move and just move. The editor disappears, and it’s just you and the text.
That’s when you understand why people love Vim.