Note | |
---|---|
Substantial revisions to this section, including new tables of commands, are in the works. Stay tuned. |
Vi (pronounced VEE-EYE)[38] “was the first real screen-based editor for Unix systems.”[39] It is present on all Unix and Unix-like operating systems (including Linux). Another frequently used text editor, GNU Emacs (discussed in Section 5.2, “GNU Emacs”), is usually (but not always) installed as well. You can start vi by typing vi or vi file_to_edit
(such as vi lab0.c
) at the prompt.
Unfortunately, I am not familiar with vi, so I cannot provide much help with using it. If you are interested in using vi, try typing :help[40] when you are in vi to access its built-in help. You can also start a tutorial by typing vimtutor
at the shell prompt. The most valuable command in any text editor is quitting without saving any changes, which is :q![40] in vi.
References to further reading on vi can be found in Section A.4.1, “More on vi”.
[38] Arnold Robbins, Elbert Hannah, and Linda Lamb, Learning the vi and Vim Editors, 7th ed (Sebastopol: O'Reilly, 2008), Chapter 1.
[39] Matthias Kalle Dalheimer and Matt Welsh, Running Linux, 5th ed., Section 19.1: "Editing Files Using vi."
[40] Note that there is a colon (:
) in the command. It's easy to overlook it.