.ps 14 .ce .B Ex changes \- Version 3.1 to 3.5 .R .PP This update describes the new features and changes which have been made in converting from version 3.1 to 3.5 of .I ex . Each change is marked with the first version where it appeared. .SH .ce \s12Update to Ex Reference Manual\s10 .SH Command line options .IP 3.4 A new command called .I view has been created. .I View is just like .I vi but it sets .I readonly . .IP 3.4 The encryption code from the v7 editor is now part of .I ex . You can invoke .I ex with the \-x option and it will ask for a key, as .I ed . The .I ed .I x command (to enter encryption mode from within the editor) is not available. This feature may not be available in all instances of .I ex due to memory limitations. .SH Commands .IP 3.4 Provisions to handle the new process stopping features of the Berkeley TTY driver have been added. A new command, .I stop , takes you out of the editor cleanly and efficiently, returning you to the shell. Resuming the editor puts you back in command or visual mode, as appropriate. If .I autowrite is set and there are outstanding changes, a write is done first unless you say ``stop!''. .IP 3.4 A .DS :vi .DE command from visual mode is now treated the same as a .DS :edit or :ex .DE command. The meaning of the .I vi command from .I ex command mode is not affected. .IP 3.3 A new command mode command .I xit (abbreviated .I x ) has been added. This is the same as .I wq but will not bother to write if there have been no changes to the file. .SH Options .IP 3.4 A read only mode now lets you guarantee you won't clobber your file by accident. You can set the on/off option .I readonly (\fIro\fP), and writes will fail unless you use an ! after the write. Commands such as .I "x, ZZ," the autowrite option, and in general anything that writes is affected. This option is turned on if you invoke ex with the \-R flag. .IP 3.4 The .I wrapmargin option is now usable. The way it works has been completely revamped. Now if you go past the margin (even in the middle of a word) the entire word is erased and rewritten on the next line. This changes the semantics of the number given to wrapmargin. 0 still means off. Any other number is still a distance from the right edge of the screen, but this location is now the right edge of the area where wraps can take place, instead of the left edge. Wrapmargin now behaves much like fill/nojustify mode in .I nroff . .IP 3.3 The options .I "w300, w1200," and .I w9600 can be set. They are synonyms for .I window, but only apply at 300, 1200, or 9600 baud, respectively. Thus you can specify you want a 12 line window at 300 baud and a 23 line window at 1200 baud in your EXINIT with .DS :set w300=12 w1200=23 .DE .IP 3.3 The new option .I timeout (default on) causes macros to time out after one second. Turn it off and they will wait forever. This is useful if you want multi character macros, but if your terminal sends escape sequences for arrow keys, it will be necessary to hit escape twice to get a beep. .IP 3.3 The new option .I remap (default on) causes the editor to attempt to map the result of a macro mapping again until the mapping fails. This makes it possible, say, to map q to # and #1 to something else and get q1 mapped to something else. Turning it off makes it possible to map ^L to l and map ^R to ^L without having ^R map to l. .IP 3.3 The new (string) valued option .I tags allows you to specify a list of tag files, similar to the ``path'' variable of csh. The files are separated by spaces (which are entered preceded by a backslash) and are searched left to right. The default value is ``tags /usr/lib/tags'', which has the same effect as before. It is recommended that ``tags'' always be the first entry. On Ernie CoVax, /usr/lib/tags contains entries for the system defined library procedures from section 3 of the manual. .SH Environment enquiries .IP 3.4 The editor now adopts the convention that a null string in the environment is the same as not being set. This applies to TERM, TERMCAP, and EXINIT. .SH .ce \s12Vi Tutorial Update\s0 .SH Deleted features .IP 3.3 The ``q'' command from visual no longer works at all. You must use ``Q'' to get to ex command mode. The ``q'' command was deleted because of user complaints about hitting it by accident too often. .IP 3.5 The provisions for changing the window size with a numeric prefix argument to certain visual commands have been deleted. The correct way to change the window size is to use the z command, for example z5 to change the window to 5 lines. .IP 3.3 The option "mapinput" is dead. It has been replaced by a much more powerful mechanism: ``:map!''. .SH Change in default option settings .IP 3.3 The default window sizes have been changed. At 300 baud the window is now 8 lines (it was 1/2 the screen size). At 1200 baud the window is now 16 lines (it was 2/3 the screen size, which was usually also 16 for a typical 24 line CRT). At 9600 baud the window is still the full screen size. Any baud rate less than 1200 behaves like 300, any over 1200 like 9600. This change makes .I vi more usable on a large screen at slow speeds. .SH Vi commands .IP 3.3 The command ``ZZ'' from vi is the same as ``:x''. This is the recommended way to leave the editor. Z must be typed twice to avoid hitting it accidently. .IP 3.4 The command ^Z is the same as ``:stop''. Note that if you have an arrow key that sends ^Z the stop function will take priority over the arrow function. If you have your ``susp'' character set to something besides ^Z, that key will be honored as well. .IP 3.3 It is now possible from visual to string several search expressions together separated by semicolons the same as command mode. For example, you can say .DS /foo/;/bar .DE from visual and it will move to the first ``bar'' after the next ``foo''. This also works within one line. .IP 3.3 ^R is now the same as ^L on terminals where the right arrow key sends ^L (This includes the Televideo 912/920 and the ADM 31 terminals.) .IP 3.4 The visual page motion commands ^F and ^B now treat any preceding counts as number of pages to move, instead of changes to the window size. That is, 2^F moves forward 2 pages. .SH Macros .IP 3.3 The ``mapinput'' mechanism of version 3.1 has been replaced by a more powerful mechanism. An ``!'' can follow the word ``\fBmap\fP'' in the .I map command. \fBMap!\fP'ed macros only apply during input mode, while \fBmap\fP'ed macros only apply during command mode. Using ``\fBmap\fP'' or ``\fBmap!\fP'' by itself produces a listing of macros in the corresponding mode. .IP 3.4 A word abbreviation mode is now available. You can define abbreviations with the .I abbreviate command .DS :abbr foo find outer otter .DE which maps ``foo'' to ``find outer otter''. Abbreviations can be turned off with the .I unabbreviate command. The syntax of these commands is identical to the .I map and .I unmap commands, except that the ! forms do not exist. Abbreviations are considered when in visual input mode only, and only affect whole words typed in, using the conservative definition. (Thus ``foobar'' will not be mapped as it would using ``map!'') Abbreviate and unabbreviate can be abbreviated to ``ab'' and ``una'', respectively.