^X^C
, and reply y to save the file. To
quit, abandoning the changes you have made, type ^X^C
, and reply
n to not save the file, but then reply yes to quit.
For more commands see the emacs reference card, included at the
end of this manual.
While in the editor pressing the i key puts the user in
the mode for inserting text. To get back into the vi command mode press the
<ESC> key or ctrl-[
. To get to the ex command
mode type the colon (:) key.
Some basic ex commands are:
r | read the specified file into the buffer |
w | write the contents of the buffer to the file filename |
q | quit vi |
s | searches for a match against the specified regular expression |
r! |
when followed by a shell command inserts the output of that |
command into the file (after the curent line) |
It is possible to create a file called .exrc that contains the settings and initial commands that are executed every time vi is invoked. Refer to the section on Setting Up Your Environment for a sample of this file.