Tutorial #2 vi navigation
1. Log on to UNIX if necessary.
2. Bring up your phone.list file (created in Tutorial #1 - vi ) in vi.
3. Add about 25 lines, so the file takes up more than one screen.
Don't worry about the data or the correctness of it, but try to
maintain the same format of the first name, last name, area code,
and phone number. Then save the file with the changes.
4. Bring up the same file and practice using the cursor movement
commands for words ( w and b) and blank delimited words ( W
and B ) in phone.list. Then try pressing Return in command mode
to move to the next line (and - to move to the beginning of the
previous line. Try moving to the ends of the current line using 0
and $ .
5. Try the scrolling commands (^F, ^B ) to see all of the
file. Then delete an entire line using x. Notice that the carriage
return is not deleted. Correct or change a few of the names in
your listing. Then save the file.
6. Create another file named explain.prac. Include the following
text in it. Be consistent in your typing. If you continue on a line
following the sentence end, put two spaces following the period
and include an extra blank line between paragraphs.
What is vi?
It is an editor,
but it is neither a line editor nor a full-screen editor.
You can insert characters,
and you can delete them.
You can't use the full screen in insert mode,
but you can in command mode.
In insert mode, you can correct only
what you have just typed on the current line.
In command mode,
you can correct whatever you can move the cursor to.
End of Report
John F. Croft
7. Save explain.prac, and then bring it into vi again.
8. Try moving by words, then try doing it by sentences and
paragraphs. Use repeat factors in several of the commands.
9. Remove the word and from the fifth line, and then change the
first character in you in that line to an uppercase letter. Change
the comma that ends line 4 to a period. Save the file.
If it doesn't work:
A. The cursor movement commands should work. Practice some
more until all have the effect that you expect. If you put only one
space after a period or question mark, vi won't recognize it as a
sentence. If you didn't leave blank lines, vi won't recognize the
end of a paragraph.
B. Remember that you must be in command mode to use the
commands. Press Escape (ESC) as soon as an insertion is
completed.
Questions? Robert Katz:
rkatz@ned.highline.edu
Last Update June 26, 2002