[CONTACT]

[ABOUT]

[POLICY]

A quickie about exiting Just

Found at: republic.circumlunar.space:70/~katolaz/phlog/20190130_quickie.txt

   A quickie (about exiting vi(1))   
====================================

Just a quick one. When I logged on republic.circumlunar.space today, the
MOTD read:

  "If you accidentally end up inside vi, you can quit it by pressing Escape, colon
  (:), q (q), bang (!) and pressing return."

Well, that's factually correct, but I am sure that very few of the
hard-core vim-enthusiasts know that there is a much quicker and
easier-to-remember way to exit from (any version of) vi(1), and saving
your stuff at the same time:

  "[ESC]ZZ"

i.e., press Escape, then Z, then Z. It is equivalent to

  "[ESC]:wq![RETURN]"

but it is shorter and does not even require a [RETURN]

:P

 -+-+-+-

vi(1) was developed by Bill Joy at Berkeley, as a "visual-mode" for
ex(1). The ex(1) line editor was Joy's own augmented version of ed(1),
and was based on an earlier editor called em(1) ("Ed for Mortals")
developed by George Colouris in Autumn 1975 at Queen Mary College
London, on a UNIXv4 [1].  That installation is believed to have been the
first UNIX installation in the UK.

It is still possible to use ex(1) today, either by running `ex` or by 
running `vi -e`. Actually, `vi` used to be a link to `ex`, even if
nowadays many unix systems have adopted the opposite convention (i.e.,
making `ex` a link to `vi` or `vim`).

[1] https://www.coulouris.net/cs_history/em_story/

[ESC]ZZ 


AD: