vi Control Mode Commands

Table 2.10 shows a complete list of all vi control mode commands.

Table B-10. vi Control Mode Commands

Command Meaning
h Move left one character
l Move right one character
w Move right one word
b Move left one word
W Move to beginning of next non-blank word
B Move to beginning of preceding non-blank word
e Move to end of current word
E Move to end of current non-blank word
0 Move to beginning of line
^ Move to first non-blank character in line
$ Move to end of line
i Insert text before current character
a Insert text after current character
I Insert text at beginning of line
A Insert text at end of line
R Overwrite existing text
dh Delete one character backward
dl Delete one character forward
db Delete one word backward
dw Delete one word forward
dB Delete one non-blank word backward
dW Delete one non-blank word forward
d$ Delete to end of line
d0 Delete to beginning of line
D Equivalent to d$ (delete to end of line)
dd Equivalent to 0d$ (delete entire line)
C Equivalent to c$ (delete to end of line, enter input mode)
cc Equivalent to 0c$ (delete entire line, enter input mode)
x Equivalent to dl (delete character forwards)
X Equivalent to dh (delete character backwards)
k or - Move backward one line
j or + Move forward one line
G Move to line given by repeat count
/ string Search forward for string
? string Search backward for string
n Repeat search forward
N Repeat search backward
f x Move right to next occurrence of x
F x Move left to previous ...

Get Learning the bash Shell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.