Tutorial #3 - vi deleting and inserting


1. Log on to UNIX if necessary.  

2. Create a file named my.address with the contents of your name 

and address, if this file does not already exist.

3. Bring up your phone.list file (created in Tutorial #1 - vi ) in vi. 

 Insert a blank line every five or six lines.

4. Delete a paragraph, then restore it.

5. Delete a blank line with a single command, and then restore it. 

 Delete a line, using repeated delete word commands.  Then try the 

restore command.

6. Delete two blank lines with a single command.  Try the 

command repeat symbol to delete the next two.

7. Save the file in its current form as new.files.  Then abandon the 

changes so the original file is unchanged.

8. Bring explain.prac file into vi.  Delete the third paragraph and 

then restore it.

9. Add a paragraph before End of Report; use any text you want, 

taking about five or six lines.  Try removing the insertion with u, 

and then type u again to restore it.

10. Append the contents of the work buffer to the file my.address, 

and then save the changed version of explain.prac.

11. Bring my.address into vi and notice that it contains the report.

12. Insert a blank line between the former contents of my.address 

and the new text; Then save the file.

If it doesn't work:

A.  Take your time.  Remember that u affects only the very latest 
deletion or insertion.  Only cursor movement commands can occur 
between the change you want to undo and the undo command.

B. Press Escape (ESC) whenever you aren't sure what mode you 
are in.  If you are already in command mode, you should hear a 
beep, but that's all right.  On some systems, arrow keys put you in 
command mode as well.

Questions? Robert Katz:rkatz@ned.highline.edu
Last Update July 2, 2002