Basic motion commands
k <up> h l <left> <right> j <down>
h <Left> | [count] characters to the left (exclusive) |
l <Right> <Space> | [count] characters to the right (exclusive) |
k <Up> CTRL-P | [count] lines upward |
j <Down> CTRL-J <NL> CTRL-N | [count] lines downward (linewise) |
0 <Home> | To the first character of the line (exclusive) |
^ | To the first non-blank character of the line |
$ <End> | To the end of the line and [count – 1] lines downward |
g0 g<Home> | To the first character of the screen line (exclusive) when lines wrap (‘wrap on). Differs from 0 when a line is wider than the screenTo the leftmost character of the current line that is on the screen when lines don’t wrap (‘wrap’ off). Differs from 0 when the first character of the line is not on the screen |
g^ | To the first non-blank character of the screen line (exclusive) when lines wrap (‘wrap’ on). Differs from ^ when a line is wider than the screen.To the leftmost non-blank character of the current line that is on the screen when lines don’t wrap (‘wrap’ off). Differs from ^ when the first non-blank character of the line is not on the screen |
g$ g<End> | To the last character of the screen line and [count – 1] screen lines downward (inclusive) when lines wrap (‘wrap’ on). Differs from $ when a line is wider than the screen.To the rightmost character of the current line that is visible on the screen when lines don’t wrap (‘wrap’ off). Differs from $ when the last character of the line is not on the screen or when a count is used |
f{char} | To [count]’th occurrence of {char} to the right. The cursor is placed on {char} (inclusive) |
F{char} | To the [count]’th occurrence of {char} to the left. The cursor is placed on {char} (inclusive) |
t{char} | Till before [count]’th occurrence of {char} to the right. The cursor is placed on the character left of {char} (inclusive) |
T{char} | Till after [count]’th occurrence of {char} to the left. The cursor is placed on the character right of {char} (inclusive) |
; | Repeat latest f, t, F or T [count] times |
, | Repeat latest f, t, F or T in opposite direction [count] times |
- <minus> | [count] lines upward, on the first non-blank character (linewise) |
+ CTRL-M <CR> | [count] lines downward, on the first non-blank character (linewise) |
_ <underscore> | [count] – 1 lines downward, on the first non-blank character (linewise) |
CTRL-End G | Goto line [count] on the first non-blank characterDefault: last line. |
CTRL-Home gg | Goto line [count] on the first non-blank characterDefault: first line. |
SHIFT-Right w | [count] words forward |
CTRL-Right W | [count] WORDS forward |
e | Forward to the end of word [count] |
E | Forward to the end of WORD [count] |
SHIFT-Left b | [count] words backward |
CTRL-Left B | [count] WORDS backward |
ge | Backward to the end of word [count] |
gE | Backward to the end of WORD [count] |
H | Move to the top of the screen |
M | Move to the middle of the screen |
L | Move to the bottom of the screen |
zz | Scroll the line with the cursor to the center of the screen |
zt | Scroll the line with the cursor to the top |
zb | Scroll the line with the cursor to the bottom |
The following commands move over words or WORDS.
A word consists of a sequence of letters, digits and underscores, or a sequence of other non-blank characters, separated with white space (spaces, tabs, <EOL>). This can be changed with the ‘iskeyword’ option.
A WORD consists of a sequence of non-blank characters, separated with white space. An empty line is also considered to be a word and a WORD.
( | [count] sentences backward |
) | [count] sentences forward |
{ | [count] paragraphs backward |
} | [count] paragraphs forward |
]] | [count] sections forward or to the next ‘{‘ in the first columnWhen used after an operator, then the ‘}’ in the first column. |
][ | [count] sections forward or to the next ‘}’ in the first column |
[[ | [count] sections backward or to the previous ‘{‘ in the first column |
[] | [count] sections backward or to the previous ‘}’ in the first column |