Up: Math 696


How to Edit Files

This is a basic guide to text editing. These instructions are part of the course Mathematical Communication and Technology in the Department of Mathematics at Texas A&M University.

Having tried out many different editors, I have become a True Believer in Emacs, but if you opt for a lesser tool, I will still talk to you.

Available programs

Asedit

Description

This is a good X-Windows based text editor.

Availability

All Mathematics Department machines, including the calclab machines. Not available on tam2000.

Advantages

On line help system; drop-down menus; spell checking available; somewhat customizable.

Disadvantages

Not available on all systems; runs only under X-Windows, so you need to know another editor to work from a dumb terminal (over a modem, for example).

Emacs

Description

The best tool for text processing in the UNIX environment (in my opinion).

Availability

Most UNIX machines worldwide.

Advantages

Extremely powerful and highly customizable and extendible. A total work environment: can be used not only for text editing, but for reading mail and news, running an interactive shell, ftp, launching other programs, working with files and directories, etc. Can be run either under X-Windows with mouse support, or from a dumb terminal. Widely available: if you go to another university, you will find Emacs there.

Disadvantages

As with any sophisticated tool, you have to invest some time to learn to use it properly.

Pico

Description

The editor that the mail program Pine uses by default. According to its creators:

Pico is a very simple and easy-to-use text editor offering paragraph justification, cut/paste, and a spelling checker.

Availability

All Department of Mathematics machines, including the calclab machines; also tam2000.

Advantages

If you use Pine for sending email, then you already know Pico. Can be used from a dumb terminal. Spell checking.

Disadvantages

No support for X-Windows: it only runs via a dumb terminal interface. Somewhat clunky.

Textedit

Description

A basic X-Windows editor.

Availability

Mathematics Department machines and tam2000; not available on the calclab machines.

Advantages

Simple and intuitive.

Disadvantages

Only available on Sun workstations; cannot be run from a dumb terminal. No bells and whistles.

Vi

Description

A fossil from the early days of UNIX.

Availability

Every UNIX system.

Advantages

Universally available; quite powerful. People who grew up with it can type incredibly fast with it, because of intelligent key bindings. Still has many True Believers.

Disadvantages

Runs only via a dumb terminal interface. Like UNIX, arcane and hard to learn and use.

WordPerfect

Description

Commercial word processor.

Availability

Only on fourier; license allows only a limited number of simultaneous users.

Advantages

People who know the PC version can use it with no trouble. Actually a word processor rather than a text editor: it does its own text formatting.

Disadvantages

Useless for LaTeX work, because you have to disable its own formatting. Not widely available in the X-Windows world, because it is an expensive commercial product.

Xedit

Description

A very basic X-Windows editor.

Availability

The main Mathematics Department server, the calclab machines, and tam2000.

Advantages

Simple to use.

Disadvantages

No bells and whistles; cannot be used from a dumb terminal; not universally available.

Common Features

File operations

All text editors have a means to save files to disk and to open existing files. Usually there is a menu along the top or bottom of the window. For editors with X-Windows support, clicking the mouse on the "File" item opens a drop-down menu with "Save" and "Open" options. More sophisticated editors can display a directory listing and let you choose a file name with the mouse.

Cursor motion

Usually you can move the cursor around the screen with the arrow keys; sometimes with the "Page up" and "Page down" keys. You can also position the cursor with the mouse; you may or may not need to click the mouse to reposition the cursor. Editors with mouse support usually have a scroll bar too. Most editors have keyboard shortcuts for cursor motion.

Cut and paste

All editors let you select or cut text and copy or move it elsewhere. If you have mouse support, you typically select text by highlighting it: hold down the left mouse button and drag the mouse across the text. Usually the highlighted text is automatically put on the clipboard: paste it elsewhere by clicking the middle mouse button.

There is usually an "Edit" item on the menu bar. The drop-down Edit menu will have cut and paste options on it.

Search and replace

Any editor lets you search for specified strings of characters. Decent ones let you replace strings either locally or globally and either with or without confirmation. Good editors can also handle UNIX "regular expressions." Look for search and replace on the drop-down Edit menu; there are usually keyboard shortcuts too.

Buffers and windows

Most editors support multiple buffers: temporary storage locations for pieces of text. Good X-Windows editors also allow you to open multiple windows on the screen (useful for working with two different files or two parts of the same file).

Customization

You can change the appearance and operation of many editors. Look for a "Preferences" or "Options" menu entry. Some editors will store a "dot file" in your home directory that records your preferences. The look and feel of X-Windows editors can be modified through your .Xdefaults file.


Up: Math 696


Comments to Harold P. Boas.

Created August 1995.