Adding and Deleting Text in vi
Adding and deleting text in vi is a bit more complicated than doing the same in pico. Whereas in pico, you basically just place your cursor where you want to make changes, vi has a whole slew of commands that you use to specify where the changes should occur. (Tables 4.1, 4.2, and 4.3 list only a very few of your options.) Plus, to issue the commands, you have to switch to command mode.
COMMAND | FUNCTION |
---|---|
a | Adds text after the cursor |
A | Adds text at the end of the current line |
i | Inserts text before the cursor |
I | Inserts text at the beginning of the current line |
o | Inserts a blank line after the current line |
O | Inserts a blank line before the current line |
COMMAND ... |
---|
Get Unix Third Edition: Visual Quickstart Guide 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.