Movement Commands
A number preceding a command repeats the movement. Movement commands are also objects for change, delete, and yank operations.
Character
Command | Action |
---|---|
h , j , k , l
| Left, down, up, right (![]() ![]() ![]() ![]() |
Spacebar
| Right |
Backspace
| Left |
Ctrl-H
| Left |
Text
Command | Action |
---|---|
w , b
| Forward, backward by word (treating punctuation marks as words). |
W , B
| Forward, backward by word (recognizing only whitespace, not punctuation, as separators). |
e
| End of word (treating a punctuation mark as the end of a word). |
E
| End of word (recognizing only whitespace as the end of a word). |
) , (
| Beginning of next, current sentence. |
} , {
| Beginning of next, current paragraph. |
]] , [[
| Beginning of next, current section. |
Ctrl-D | Move to previous tab setting. |
Ctrl-T | Move to next tab setting. |
Ctrl-W | Move back one word. |
Lines
Command | Action |
---|---|
0 , $
| First, last position of current line. |
^ , _
| First nonblank character of current line. |
+ , -
| First character of next, previous line. |
Return | First nonblank character of next line. |
n|
| Column n of current line. |
H
| Top line of screen. |
M
| Middle line of screen. |
L
| Last line of screen. |
nH
| n lines after top line. |
nL
| n lines before last line. |
Ctrl-J | Move down one line. |
Ctrl-M | Move to first nonblank character of next line. |
Screens
Command | Action |
---|---|
Ctrl-F, Ctrl-B | Scroll forward, backward one screen. |
Ctrl-D, Ctrl-U | Scroll down, up one-half screen. |
Ctrl-E, Ctrl-Y | Show one more line at bottom, top of window. |
z Return
| Reposition line with cursor to top of screen. |
z.
| Reposition line with cursor to middle of screen. |
z-
| Reposition line with cursor to bottom of screen. |
Ctrl-L, Ctrl-R | Redraw screen (without scrolling). |
Searches
Command | Action |
---|---|
/ pattern
| Search forward for pattern. |
/
| Repeat previous search forward. |
/ pattern/+ n
| Go to line n after pattern. |
? pattern
| Search backward for pattern. |
?
| Repeat previous search backward. |
? pattern?- n
| Go to line n before pattern. |
n
| Repeat previous search. |
N
| Repeat previous search in opposite direction. |
%
| Find match of current parenthesis, brace, or bracket. |
f x
| Move forward to x on current line. |
F x
| Move backward to x on current line. |
t x
| Move forward to just before x in current line. |
T x
| Move back to just after x in current line. |
,
| Reverse search direction of last f, F, t, or T. |
;
| Repeat last character search (f, F, t, or T). |
Line numbering
Command | Action |
---|---|
Ctrl-G | Display current filename and line number. |
nG
| Move to line number n. |
G
| Move to last line in file. |
: n
| Move to line number n. |
Marking position
Command | Action |
---|---|
m x
| Mark current position with character x. |
` x
| (backquote) Move cursor to mark x. |
' x
| (apostrophe) Move to start of line containing x. |
``
| (backquotes) Return to previous mark (or location prior to search). |
''
| (apostrophes) Like preceding, but return to start of line. |