home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

Learning the Korn Shell

Learning the Korn ShellSearch this book
Previous: B.7 Emacs Mode Commands Appendix B
Reference Lists
Next: C. Obtaining Sample Programs

B.8 Vi Control Mode Commands

Here is a complete list of all 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 backwards
dl Delete one character forwards
db Delete one word backwards
dw Delete one word forwards
dB Delete one non-blank word backwards
dW Delete one non-blank word forwards
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 backwards)
X Equivalent to dh (delete character forwards)
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
, Undo motion of last character finding command
; Redo last character finding command
\ 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

Run the fc command on the current line (actually, run the command fc -e ${VISUAL:-${EDITOR:-vi}} ). Usually this means run the full vi on the current line.


Start a new line and redraw the current line on it


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

x Insert expansion of alias _x

Previous: B.7 Emacs Mode Commands Learning the Korn Shell Next: C. Obtaining Sample Programs
B.7 Emacs Mode Commands Book Index C. Obtaining Sample Programs

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System