"EX" TEXT EDITOR The text editor ex is based on, and is essentially compatible with the Unix editor ed. Ex accepts the commands used with ed and offers many additional features. The most noticeable difference between the edi- tors is the feedback provided by ex: it prompts for commands by print- ing ":" and gives useful diagnostic messages. Many features help protect the ex user from the loss of work. Under most circumstances, ex's recovery mechanism is able to save work to within a few lines of changes after a crash or if the phone is hung up accidentally. The undo command can reverse the effects of the last buffer-editing command, and the write command has certain checks which make it more difficult to accidentally destroy files. Users of ed can switch to ex and benefit from these features while continuing to use the same editing commands. Edit is the name of a version of ex which is designed for beginning and casual users. Type "help edit" for more information. Documentation: The Ex Reference Manual (Version 1.1), is available from the Computer Center Library, 218 Evans. A tutorial for beginning users, ``Edit: A tutorial'', can also be obtained there. This write-up ("help ex") is intended to introduce users of the older editors to some of ex's most significant features. Commands: Descriptions of all ex commands are given on pages 7-15 of the Ex Reference Manual. A command may be given by typing either its full name (generally a word which describes its function), or an abbreviation. All one-letter ed commands are valid abbrevia- tions in ex and work the same way in ex with one minor exception: read (r) by default places the contents of the file read after the current line (.). (The default in ed is at the end of the buffer.) The summaries that follow introduce a few useful commands that have no equivalent in ed. help: provides information about the editor in a way similar to Unix help. Enter the editor and type "help index" for more informa- tion. New topics may be added periodically. recover: is used to recover a buffer lost in a crash or when the phone is accidentally hung up. Enter the editor and use the help command to find out more: "help recover" and "help saferecover". preserve: Saves the buffer as if the editor had just crashed. Used in emergencies when a write command has resulted in an error and you don't know how to save your work. After a preserve you should seek help. undo (u): reverses the effects of the last command which had the poten- tial of changing the buffer. Among the commands which can be un- done are append (a), change (c), copy (co), delete (d), global (g), move (m), substitute (s). The commands edit (e) and write (w) cannot be undone. z: print segments of text (enough to fill the screen of a crt termi- nal). By default, start with the current line, or specify a dif- ferent position (e.g., "1z"). Other options available; see page 14 of the Ex Reference Manual. join (j): join lines, adjusting blank space. By default, join the current line to the one after it, or specify another range (e.g., "3,7j"). Open and Visual Modes: alternative modes of editing entered with the commands open (o) and visual (vi) respectively. They are described on pages 16-24 of the Ex Reference Manual. The editor behaves differently in open and visual modes, keeping track of a current position in the line, as reflected by the position of the cursor. Commands are not displayed on the terminal, but their ef- fects on the text are shown immediately. If the editor behaves strangely, you may have accidentally entered open mode by typing "o". Type a "q" to get out of open or visual mode and back into the regular editor command mode. Options: Ex has a set of options which allow the user to change the editing environment. A summary of the available options is on page 2 of the reference manual, and descriptions are given on pages 27-30. Options are set with the command "set". For exam- ple, typing "set noopen" sets an option which will not allow the user to enter open or visual mode (accidental or otherwise). "set open" reverses the option.