Next: Editing another file Up: Using the vi Previous: Moving commands

Saving files and quitting vi

To quit vi without making changes to the file, use the command :q!. When you type the ``:'', the cursor will move to the last line on the screen; you'll be in last line mode.

In last line mode, certain extended commands are available. One of them is q!, which quits vi without saving. The command :wq saves the file and then exits vi. The command ZZ (from command mode, without the ``:'') is equivalent to :wq.

To save the file without quitting vi, just use :w.


abraham@iesd.auc.dk