Previous Table of Contents Next


Vi Input Mode Commands

#, <BACKSPACE> delete the previous character
Ctl-d terminate the Korn shell
Ctl-v escape the next character
Ctl-w delete the previous word
Ctl-x, @ kill the entire line
<RETURN> execute the current line
\ escape the next erase or kill character

Vi Motion Edit Commands

[n]b, [n]<BACKSPACE> move left one character
[n]l, [n]<SPACE> move forward one character
[n]b move backward one word
[n]B move backward one word; ignore punctuation
[n]w move forward one word
[n]W move forward one word; ignore punctuation
[n]e move to the end of the next word
[n]E move to end of next word; ignore punctuation
[n]fc move forward to character c
[n]Fc move backward to character c
[n]tc move forward to character before character c
[n]Tc move backward to character before character c
[n]; repeat the last f, F, t, or T command
[n], repeat the last f, F, t, or T command, but in the opposite direction
0 move cursor to start of line
^ move cursor to first non-blank character in line
$ move cursor to end of line

Vi Search/Edit History Commands

[n]G get last command (or command n)
[n]j, [n]+ get next command from history file
[n]k, [n] get previous command from history file
n repeat last / or ? search
N repeat last / or ? search, except in opposite direction
/string search backward in the history file for command that matches string
?string search forward in the history file for command that matches string

Vi Text Modification Commands

a add text after the current character
A append text to end of the current line
[n]cx, c[n]X change current character up to the cursor position defined by X
[n]dX, d[n]X delete current character up to the cursor position defined by X
[n]yX, y[n]X copy current character up to the cursor position defined by X into buffer
X used to define ending cursor position for c, d, or y commands
b backwards to beginning of word
e cursor to end of current word
w cursor to beginning of next word
W B E same as w b e, except ignore punctuation
0 before cursor to end of current line
$ cursor to end of current line
C change current character to end of line
D delete current character through end of line
i insert text left of the current character
I insert text before beginning of line
[n]p put previously yanked/deleted text after cursor
[n]P put previously yanked/deleted text before cursor
[n]rc replace current character with c
R replace text from cursor to <ESCAPE>
S delete entire line and enter input mode
yy copy the current line into the buffer
[n]x delete the current character
[n]X delete the previous character
[n]. repeat the last text modification command
[n]~ toggle the case of the current character
[n]_ append last word of previous ksh command
\ replace the current word with the filename that matches word*. For unique matches, append a / to directories and " " (space) for files.

Vi Other Edit Commands

u undo the last text modification command
U undo all text modification commands on the current line
[n]v return the output of the fc –e command
Ctl-l redisplay current line
Ctl-j execute the current line
Ctl-m execute the current line
# insert a # (comment) at beginning of the current line
= list the files that match the current word*
* replace current word with the files that match word*
@_c insert value of alias c


Previous Table of Contents Next
1