From: Eef Hartman on
John F. Morse <john(a)example.invalid> wrote:
> w to write
> q to quit
>
> Or, when you are finished editing use :wq to write and quit.

Or even more simple: x to "exit, possible with save"
(x is the same as q when the document hasn't changed, but as wq
when it HAS been modified, vi keeps that state for you).
BTW: the "visual mode" ZZ command does the same as :x
--
*******************************************************************
** Eef Hartman, Delft University of Technology, dept. SSC/ICT **
** e-mail: E.J.M.Hartman(a)tudelft.nl - phone: +31-15-278 82525 **
*******************************************************************