Vi and Emacs
It is strongly recommended that you become familiar with one (or both) of the main terminal-based text editors found on many UNIX systems: vi and/or emacs. There are many different versions of each, including those which work in a graphical (windowing) environment and those which just work in a terminal window.
Documentation
How to run the programs on ITEE servers?
- To start vi in a terminal window, you can type vim (for vi "improved") or just vi followed by the name of the file to be edited. vim is an updated version of vi and it is recommended that you use this instead of vi. gvim is the graphical version.
- To start GNU emacs, type emacs. This will start the graphical version if you have an X display or the terminal version if you don't. emacs -nw will always start the terminal version. There is also xemacs available.
Windows and other versions of both programs are available (see the resources links below).
How to learn one or the other?
The easiest way to start learning vi/emacs is to run the program and start an online tutorial. On agave.students.itee.uq.edu.au you can run one of the following commands:
- Vi: vimtutor - this runs vim (vi "improved") with a tutorial that you can work through
- Emacs: run the command emacs and type Control-h t (i.e. Control-h followed by lowercase t) - this runs the built in tutorial
The textbook (Glass & Ables) also has a brief introduction to both editors - see pages 57 to 75.
Which is better?
Well that's a religious argument that has been going on for years (decades now!). They both have their advantages and disadvantages. You can find many websites which compare and contrast the two, e.g.
- http://www.io.com/~dierdorf/emacsvi.html
- http://c2.com/cgi/wiki?EmacsAndVi
- http://c2.com/cgi/wiki?EmacsVsVi
- http://www.arcterex.net/editor.html
Vi resources
- Vi according to Google - lots of links to Vi related sites
- Vim book (3.7MB PDF) - first couple of chapters are a good starting point
- Mastering the VI editor - tutorial hosted at the University of Hawaii
- Vi Text Editor Tutorial - tutorial hosted at the Purdue University
- Introduction to Vi - tutorial hosted at Arizona State University
Emacs resources
- Emacs according to Google - lots of links to Emacs related sites
- A Tutorial Introduction to GNU Emacs - tutorial hosted at the University of Chicago
- Emacs Beginner's Tutorial
- Emacs 101
