UNIX IV: Text Editors
- Text Editors are programs that create and manipulate
text (ascii) files.
- Text editors are particularly important for us because C programs
("source code") are text files.
- The two most popular text editors on UNIX machines are vi
and EMACS.
- People have religious wars all the time about which text editor
is "better", but here are the main pros and cons:
- PRO: vi is small, fast, and is on every UNIX computer.
- CON: vi can be hard to use at first.
- PRO: emacs is powerful, easy to use, and infinitely extensible.
- CON: emacs is big and can be slow on many systems.
- To start editing a file named "foobar.c" in vi, type
vi foobar.c. For EMACS, type emacs foobar.c.
- Regardless of what editor you use, you can always type
more (file name) to view the contents of the text file
(file name) and lpr (file name) to print it
on the nearest printer.
Next Slide