vi Editing Commands
vi changes the content of the text file in response to keys that you press. Table 18-2 shows the most useful commands.
Operation | Command | What It Does |
---|---|---|
Insert | i | Inserts text before the cursor. (Insert mode) |
a | Inserts text after the cursor. (Insert mode) | |
o | Inserts a line after the current line. (Insert mode) | |
O | Inserts a line before the current line. (Insert mode) | |
A | Appends text at the end of the line. (Insert mode) | |
I | Inserts text at the start of the current line. (Insert mode) | |
Delete | x | Deletes the character under the cursor. |
dd | Deletes the current line. Saves line in a buffer. | |
dw | Deletes the next word. | |
D | Deletes from the cursor to the end of the line. | |
Replace | rx | Replaces the current character with x. |
s | Replaces one ... |
Get Spring Into Linux® 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.