Department of Computing
|
Imperial College London
|
Text editors
|
The following text editors are available on the Linux machines.
-
xemacs
- XEmacs is a version of Emacs, compatible with and containing many
improvements over GNU Emacs. The primary documentation of XEmacs
is in the XEmacs Reference Manual, which you can read on-line
using Info, a subsystem of XEmacs. Please look there for complete
and up-to-date documentation. There is an extensive interactive help
facility. CTRL-h enters the Help facility. Help Tutorial (CTRL-h t)
requests an interactive tutorial which can teach beginners the fundamentals
of XEmacs in a few minutes.
emacs
is a similar editor and the above
information on documentation and help also applies to this.
-
nedit
- NEdit is a GUI style editor for plain text files. It
provides mouse based editing and a streamlined editing
style, based on popular Macintosh and MS Windows editors,
for users of X workstations and X terminals.
-
xedit
- This is a simple X-based editor, it has limited functionality
(find, search, replace).
-
pico
-
pico is a very simple display oriented text editor, the same one that the
pine mail client uses, but split out.
-
vi
-
vi (visual) is a display oriented text editor based on
ex
. It is a useful
editor to know, since it is available on the majority of Unix machines.
It is also extremely fast. In addition to the usual online manual page
this page, although for SunOS rather
than Linux, includes a useful command summary.
Setting your default editor
There are two environment variables that are used to set your default editor: EDITOR and VISUAL.
- VISUAL
- This is your preferred full screen editor.
- EDITOR
- This is your preferred terminal editor.
The normal practice is to set them both to the same editor, but this is not
essential. For example, adding the following lines to your .cshrc file will
set your default editor to vi when using a dumb text-only terminal,
or to GNU Emacs when running on an Xterminal:
if( $TERM == xterms || $TERM == xterm ) then
# On an Xterminal use XEmacs for full screen editor
setenv VISUAL xemacs
# Use vi for terminal editor.
setenv EDITOR vi
else
# On non-X terminals use vi
setenv EDITOR vi
setenv VISUAL vi
endif
Backup files
Most editors create backup files; these are identified by a filename suffix
(e.g. .BAK), and contain the version that existed before the last save.
If you are happy with the modifications that you made to the file, then this
backup file can be deleted.
Backup files tend to have names like:
<filename>.BAK
<filename>.bak
<filename>~
<filename>%
Some editors create autosave backup files, these are stored separately from the original, so as not to over-write it. They tend to be of this format:
#<filename>#