
730
|
Chapter 9: The vi, ex, and vim Editors
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Some of the control characters listed in the previous table are set by stty. Your
terminal settings may differ.
Edit Commands
Recall that c, d, and y are the basic editing operators.
Changing and Deleting Text
The following table is not exhaustive, but it illustrates the most common
operations.
Ctrl-W Delete previous word.
Ctrl-Y Insert character found just above cursor. {vim}
Ctrl-[ (Escape) Terminate insert mode.
Command Action
cw Change word.
cc Change line.
c$ Change text from current position to end of line.
C Same as c$.
dd Delete current line.
numdd Delete num lines.
d$ Delete text from current position to end of line.
D Same as d$.
dw Delete a word.
d} Delete up to next paragraph.
d^ Delete back to beginning of line.
d/pat Delete up to first occurrence of pattern.
dn Delete up to next occurrence of pattern.
dfa Delete up to and including a on current line.
dta Delete up to (but not including) a on current line.
dL Delete up to last line on screen.
dG Delete to end of file.
gqap Reformat current paragraph to textwidth. {vim}
g~w Switch case of word. {vim}
guw Change word to lowercase. {vim}
gUw Change word to uppercase. {vim}
p Insert last deleted or yanked text after cursor.
gp Same as p, but leave cursor at end of inserted text. {vim}
]p Same as p, but ...