Just Enough to Get By
As the heading suggests, in this section I attempt to present a subset of the vi commands large enough to enable you to accomplish basic tasks, but small enough that a beginner can remember most of them. Note that the topics covered in this section are covered in more detail in other sections.
Opening and Closing
You open a file by typing “vi <filename>” on the command line— for example:
You close a file by getting into command mode (use the <Esc> key), typing a colon “:” and then typing wq (write quit). If you don't want to save changes to the file, type q (quit). If it gives you any trouble, type wq! (enthusiastic quit).
You insert new text by getting into edit mode. There are ...