vi Control Mode Commands

The material in this section also appears in Learning the bash Shell by Cameron Newham (O’Reilly).

Table A-24 shows a complete list of readline vi control mode commands.

Table A-24. vi 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 nonblank word.

B

Move to beginning of preceding nonblank word.

e

Move to end of current word.

E

Move to end of current nonblank word.

0

Move to beginning of line.

.

Repeat the last a insertion.

^

Move to first nonblank 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 nonblank word backward.

dW

Delete one nonblank 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 occurrence of x.

t x

Move right to next occurrence of x, then back one space.

T x

Move left to previous occurrence of x, then forward one space.

;

Redo last character finding command.

,

Redo last character finding command in opposite direction.

Do filename completion.

*

Do wildcard expansion (onto command line).

=

Do wildcard expansion (as printed list).

~

Invert (twiddle) case of current character(s).

Append last word of previous command, enter input mode.

Ctrl+L

Start a new line and redraw the current line on it.

#

Prepend # (comment character) to the line and send it to history.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.119.251