Edit Commands
Recall that c
, d
, and y
are the basic editing operators.
Changing and deleting text
The following table is not exhaustive, but illustrates the most common operations.
|
Change word. |
|
Change line. |
|
Change text from current position to end-of-line. |
|
Same as |
|
Delete current line. |
|
Delete num lines. |
|
Delete text from current position to end-of-line. |
|
Same as |
|
Delete a word. |
|
Delete up to next paragraph. |
|
Delete back to beginning of line. |
|
Delete up to first occurrence of pattern. |
|
Delete up to next occurrence of pattern. |
|
Delete up to and including x on current line. |
|
Delete up to (but not including) x on current line. |
|
Delete up to last line on screen. |
|
Delete to end of file. |
|
Reformat current paragraph to
|
|
Switch case of word. {vim} |
|
Change word to lowercase. {vim} |
|
Change word to uppercase. {vim} |
|
Insert last deleted or yanked text after cursor. |
|
Same as |
|
Same as |
|
Same as |
|
Insert last deleted or yanked text before cursor. |
|
Same as |
|
Replace character with x. |
|
Replace with new text (overwrite), beginning at cursor. ESCAPE ends replace mode. |
|
Substitute character. |
|
Substitute ... |
Get Unix in a Nutshell, 4th 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.