4.3BSD/usr/lib/learn/vi/L1.2

Compare this file to the similar file:
Show the results in this format:

#print
    So far, you've learned how to force vi to listen to you (the Escape
key), to redraw the screen (the ^L or ^R command), how to get out of vi
(the :q command), and how to quit even when vi thinks you shouldn't
(the :q! command).  Suppose that vi is right, however, when it prevents
you from quitting.  Suppose that you really do want to save the changes
you've made to the file.  For this vi uses the :w command.  'w' stands for
write, meaning that vi is going to write out its private copy of the file,
thereby saving your work.

   You use the :w command in the same way as you use :q.  That is, you type 
a colon, the cursor moves to the bottom of the screen, you type 'w' and hit
return, and vi saves the file.  If you wanted vi to save the file under a
different name, you could type ':w <filename>', where <filename> stands for
the new name.  Very frequently, you want to both write out the file and then
quit.  You could use the :w command followed by the :q command.  Vi also
provides a shorthand version, :wq, which will both save the file and then quit.

    Now you are ready to try out the :w command, but this time I want you to
get into the editor yourself.  When you see the percent sign, type
       vi WriteText
and when you've quit the editor type 'ready' to go to the next lesson.
#create WriteText
    Use the :w command to save this file under the name SaveTest and then
use the :wq command to save it also under its old name.

    If you don't remember how to do this, just type :q and you'll get to
see the lesson again.

    When you see the percent sign, don't forget to type 'ready' to
go on to the next lesson.
#user
#cmp WriteText SaveTest
#succeed
Very good.  Now that you can save anything you do, let's go on.
#fail
Try again.  To save a file in a new place, type
		:w <filename>
using the new name instead of '<filename>'.  For example, to save it under
the name 'blort', you'd type
		:w blort

To save it under its old name and then quit, just type
		:wq

When 'learn' types a percent sign, type 'vi WriteText' to try it again.
#next
2.1  10