vi's purpose

vi's sole purpose, IMNSHO, is to edit the Makefile to build emacs, The One True Editor.

To this end, here are the vi keys you need to know:

  • The most important is, :q! this will quit without saving, for when you delete a whole line on accident.
  • The next most important is, i this is the insert command, and it will allow you to type text at the cursor position until you hit ESC.
  • a for Add is the bastard cousin of i. a will move the cursor one spot to the right before you insert text. Also terminated with ESC.
  • Deleting is tricky. It's a two key sequence, the first key, d starts the delete, the next key determines which character to delete. I basically I only use two, dl will delete the character under the cursor, dd will delete the whole line. I sometimes use d$ to delete until the end of the line.
  • Last thing you need to know is, saving. :w will save, and :w! will force a save (if you are owner but don't have write promission). :wq Will save and quit.
Now you're ready to compile emacs.