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 your options.) Plus, to issue the commands, you have to switch between input mode and command mode.

To add or delete text in vi:

1.
vi
To begin, type vi at the shell prompt.
2.
i
Change into input mode.
3.
There once was a man from Nantucket
Type in some text that you'll want to add to.
4.
Press to enter command mode before ...

Get Unix: 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.