Here’s a quick guide to help you learn how to move around in Vim.
The Memorization Aid column contains a tip on remembering the actions of the command.
The Count column tells you if you can modify the command with a Count. A Count is a way to trigger the command more than once (equal to the value of the Count). For example, the 5w command will jump five WORDs.
Movement Commands
|
Key |
Count |
Move Type |
Action |
Memorization Aid |
|---|---|---|---|---|
|
Line |
Go to first character of the line. |
||
|
Line |
Go to the first non-whitespace character of the line. |
Similar symbol meaning in regex |
|
|
Line |
Go to the last character of the line. |
Similar symbol meaning in regex |
|
|
Words |
Jump to the first character of the next WORD |
WORD |
|
|
Words |
Jump to the first character of the next word |
word |
|
|
Words |
Jump to the last character of the next WORD |
End of WORD |
|
|
Words |
Jump to the last character of the next word |
End of word |
|
|
Words |
Jump to the first character of the previous WORD |
Back a WORD |
|
|
Words |
Jump to the first character of the previous word |
Back up a word |
|
|
Words |
Jump to the last character of the previous WORD. |
Back up to the end of a WORD |
|
|
Words |
Jump to the last character of the previous word. |
Back up to the end of a word |
|
|
Line |
Moves cursor on top of the next instance of the |
Find the character forwards |
|
|
Line |
Moves cursor on top of the previous instance of the |
Find the character backwards |
|
|
Line |
Moves cursor to one character before the next instance of the |
UnTil the character forwards |
|
|
Line |
Moves cursor to one character before the previous instance of the |
UnTil the character backwards |
|
|
Sentence |
Jump to the first character of the next sentence. |
In code, |
|
|
Sentence |
Jump to the first character of the previous sentence |
In code, |
|
|
Paragraph |
Jump to next paragraph |
In code, |
|
|
Paragraph |
Jump to previous paragraph |
In code, |
|
|
Character |
Left |
||
|
Character |
Down |
||
|
Character |
Up |
||
|
Character |
Right |
||
|
Matcher |
Jump to the matching brace under the cursor (can be used on either opening or closing brace). Works on the following braces: |
The percentage symbol is made of a slash and two matching circles, like two matching braces. |
|
|
Matcher |
Jumps to the next instance of the word. Uses the non-symbol word underneath the cursor. Otherwise it jumps to the next word if cursor is on whitespace or a symbol. |
Symmetrical with # key on your keyboard if you think of the 1 and 0 keys as the boundaries. |
|
|
Matcher |
Jumps to the previous instance of the word. Uses the non-symbol word underneath the cursor. Otherwise it jumps to the next word if cursor is on whitespace or a symbol. |
This symbol is sometimes called a “hash”. This finds a word like a hash function uses a “hash” to find a value. (It’s not perfect, but maybe you’ll remember this even better). |
|
|
Cursor/Screen |
Move cursor to the top of the screen. |
Move to the HIGH point of the screen |
|
|
Screen |
Move cursor to the center of the screen. |
Move to the MID point of the screen |
|
|
Screen |
Move cursor to the bottom of the screen. |
Move to the LOW point of the screen |
|
|
Screen |
Move screen to place cursor in the middle |
Recenter the screen to my cursor |
|
|
Screen |
Move screen to place cursor at the top |
Recenter the screen so my cursor is at the TOP |
|
|
Screen |
Move screen to place cursor at the bottom |
Recenter the screen so my cursor is at the BOTTOM |
|
|
Repeat |
Repeat movement in same direction. If direction was backwards, this movement will go forwards. |
It’s easy to jump back and forth with |
|
|
Repeat |
Repeat movement in same direction. If direction was backwards, this movement will also be backwards. |
It’s easy to jump back and forth with |
