MORE VI 

As usual, if you have a problem, raise your hand.  When you are done,
come to the TA or instructor and make sure you have your completion
of the lab recorded.  Before you go, always log off your machine.


VI FOR LIFE

1.  Again, secure shell into hilton.cec.wustl.edu as cse100x.
	You'll have to remember how to get into vi.  You just
	type vi!

2.  I am going to list a few vi commands and I want you to try
	them out.  You can't really try until you have text
	to play with, so go into insert mode, i, and type
	the lyrics of some song that's been running thru your
	head.  There's always a song in your head, right?
	There should be.

3.  A appends at the end of the current line.  Don't forget to
	use ESC to get out of the insert mode.

	Try it.

4. I inserts at the beginning of a line.  See what happens if
	the line begins with white space, such as a tab or a few
	spaces.  Where does I start inserting test?

	Try it.

5.  R puts you in a "replace mode" which is actually somewhere between
	insert mode and command mode.  It replaces as you type
	until you hit escape.  

	Try it.

6.  Can you find a difference between S and C?  I can't.

	Try both.

7.  Try each of these delete commands:

	You can use u to undo your deletion after each one.

	dd
	D (try it in the middle of a line)
	dG
	2dd
	3dd
	4dd
	d$
	d0 (try it in the middle of a line)
	d} (this would be interesting if you had a few paragraphs)
	d{
	dw
	4dw
	d4w
	dfe
	dte
	d/e (you have to hit ENTER after this)

	if there is any command you can't guess the meaning of, ask the TA
	to help guess!

8.  J joins two lines.

9.  P puts the last deletion in front of the cursor.

10.  Sorry, this item will take about ten minutes.  The best way to practice
	an editor is to actually try to write something meaningful.

	Try writing a resume for yourself in vi.  Ouch!  I want you to
	type your name and address and contact information.  Then go out
	of insert mode and fix any errors you made.

	Now add information about your education.  Again, type in insert
	mode, then go out of insert mode and use the command mode to fix
	any errors.  Remember to use / and f and w to move around.  Don't
	rely on the arrows or their keystroke equivalents.

	This is a bit of a funny resume.  Instead of typing the jobs you
	had, type the jobs you wish you will have for the next fifteen years,
	five years at each place.  Be sure to put in the dates of employment,
	including beginning month and end month, and year.  Here is where you
	start to need an editor.  You will want there to be perfect parallel
	punctuation.  If you say June 2001 - October 2004, then you need to
	say January 1999 - May 2001.  You can't say Jan 1999, and you can't use
	a double dash.  The "editing" is in making things perfect.

	Change the way it looks by putting any word that begins with a capital
	letter in all capitals.  Ha ha.  Gotcha.

	Show the TA.  You're finished with this one.