Editors 101 -- The vi Menace

In another article I discussed moving the cursor forward in vi, a very advanced topic that is not required to pass this course. To pass "Editors 101" you only need to be able to answer the following question:

Some [censored] program started vi for me. I typed a few characters before I figured out what happened. Now everything is fubar. What do I do?

The answer is:

  • Delete the program from your hard disk (required by ISO 9001).
  • Find and shoot the programmer (optional).
  • Type [ESCAPE] : q ! [RETURN].

The last sequence is the command for leaving vi. That is all you will need to know about vi, ever. You might find the command somewhat unintuitive, but actually it is not. All vi commands have nice mnemonics. The mnemonic for leaving vi is:

  • ESCAPE this
  • COLON thing, (The colon-thing is a nickname for vi.)
  • Quit and do
  • NOT (slang for "!". Here used in the meaning "never".)
  • RETURN.

That was all for this lecture. Today's exercises will consist of entering and leaving vi mode in emacs. Do not try this with the real thing. A video demonstration will be available later for interested students.

May you never need the knowledge you have just gained.


[By Per Abrahamson, from alt.religion.emacs]