\fBEx changes \- Version 2.0 to 3.1\fR
This update describes the new features and changes which have been made
in converting from version 2.0 to 3.1 of
Each change is marked with the first version where it appeared.
Versions 2.1 through 2.7 were implemented by Bill Joy; Mark Horton
produced versions 2.8, 2.9 and 3.1 and is maintaining the current version.
\s12Update to Ex Reference Manual\s10
This is suitable for invocations from within
set, just put the command
``set noshowmatch'' in your
option before starting; this is particularly suitable when invoking
edits the file with a 5 line initial window.
The text after a \fB+\fR on the command line is no longer limited
to being a line number, but can be any single command.
This generality is also available within the editor on
commands (but no blanks are allowed in such commands.)
A very useful form of this option is exemplified by
The address form \fB%\fR is short for ``1,$''.
The editor now ignores a ``:'' in front of commands, so you can say ``:wq''
command now does something sensible when you say
printing all lines containing
before this printed the first line after each line containing
have been added which are used with macros in
mode. These are described below.
command now admits an argument of the form
``+command'' as described above.
command, given no arguments, now repeats the previous
just as ``&'' does. This is easier to type.
The substititute command ``s/str'', omitting the delimiter on the
regular expression, now deletes ``str''; previously this was an error.
During pattern searches of a
mode; previously a funny, undocumented mode of searching
The editor requires that the tag names in the
The default starting address for
is followed by a number, then this number is remembered by setting the
A command consisting of only two addresses, e.g. ``1,10'' now causes
all the lines to be printed, rather than just the last line.
(which can be abbreviated
is an on/off option, off by default.
If you set this option, then the editor will perform
commands if the current file is modified and you give a
commands, (and noticeably not before
Note that there is an equivalent way to do the
command with autowrite set without the write in each case:
causes the presence or absence of
commands to be remembered, and to be toggled by repeating the suffices.
makes the substitution be as in the
option, which is numeric and defaults to 8.
Changing this to, say, 4, tells
that either you system expands tabs to every 4 spaces, or your
terminal has hardware tabs set every 4 spaces.
There is a new boolean option
which is described with the macro facility for
prompts for commands now depends only on the setting of the
variable so that you can say
will now execute initial commands from the
EXINIT environment variable rather than
if it find such a variable.
will read the terminal description from the TERMCAP
environment variable if the description there is the one for
the TERM in the environment. TERMCAP may still be a pathname (starting with
a \fB/\fR; in that case this will be used as the termcap file rather than
/etc/termcap, and the terminal description will be sought there.)
\s12Vi Tutorial Update\s10
Change in default option settings.
The default setting for the
are special in scanning patterns in
if you don't use these regularly. This makes
is no longer the default for
operations in visual now wrap around line boundaries.
Thus a sequence of enough \fBw\fR commands will get to any word after the
current position in the file, and \fBb\fR's will back up to any
previous position. Thus these are more like the sentence operations
(You still can't back around line boundaries during inserts however.)
searches now find the next or previous instance of the searched for string.
Previously, they would not find strings on the current line.
Thus you can move to the right on the current line by typing
where ``pref'' is a prefix of the word you wish to move to, and delete to
a following string ``str'' by doing ``d/str<ESC>'', whether it is on the
same or a succeeding line.
(Previously the command ``d/pat/'' deleted lines through the next line
containing ``pat''. This can be accomplished now by the somewhat unusual
command ``d/pat/0'', which is short for ``d/pat/+0''. The point is that
whole lines are affected if the search patter only specifies a line, and
using address arithmetic makes the pattern only specify a line.)
Arrow keys on terminals that send more than 1 character now
work. Home up keys are supported as are the four directions.
(Note that the HP 2621 will
turn on function key labels, and even then you have to hold
shift down to use the arrow keys.
To avoid turning on the labels, and to give up the
function keys, use terminal type 2621nl instead of 2621.)
A parameterless macro facility is included from visual.
This facility lets you say that when you type a particular key,
you really mean some longer sequence of keys.
It is useful when you find yourself typing the same sequence of
Briefly, there are two flavors of macros:
Put the macro body in a buffer register, say x. Then
type @x to invoke it. @ may be followed by another @
to repeat the last macro.
This allows macros up to 512 chars.
Use the map command from command mode
(either 1 char or 1 function key) since it must be
can be no longer than 10 chars,
To get space, tab, ``|'', or newline into
escape them with ctrl V. (It may be
necessary to escape the ctrl V with ctrl V if the map
command is given from visual mode.)
Spaces and tabs inside the
to make the Q key write and exit the editor, you can do
which means that whenever you type `Q', it will be as though you
had typed the four characters :wq\s-2CR\s+2.
The control V is needed because without it the return would
For 1 shot macros it is best to put the macro in a buffer register
and map a key to `@r', since this will allow the macro to be edited.
Macros can be deleted with
If the lhs of a macro is ``#0'' through ``#9'', this maps the particular
function key instead of the 2 char # sequence, if the terminal has
For terminals without function keys,
the sequence #\fIx\fP means function key
on terminals without function keys, the #x sequence need not be
typed within one second. The character # can be changed by using
a macro in the usual way:
to use tab, for example. (This won't affect the map command, which
still uses #, but just the invocation from visual mode.)
The undo command will undo an entire macro call as a unit.
New commands in visual: ^Y and ^E. These scroll the screen up
and down 1 line, respectively. They can be given counts, controlling
the number of lines the screen is scrolled. They differ from ^U
and ^D in that the cursor stays over the same line in the buffer
it was over before rather than staying in the same place on the
screen. (^Y on a dumb terminal with a full screen will redraw the
screen moving the cursor up a few lines.) If you're looking for
mnemonic value in the names, try this: Y is right next to U and
In visual: `&' is a synonym for `:&<cr>'.
In input mode in open and visual ^V (like tenex) is now equivalent
to ^Q (which is reminiscent of ITS) superquoting the next character.
The j, k, and l keys now move the cursor down, up, and right,
respectively, in visual mode, as they used to do (and always did on
some terminals). This is to avoid the creeping of these keys into the map
descriptions of terminals and to compensate for the lack of arrow
The $ command now sets the column for future cursor motions to
effective infinity. Thus a `$' followed by up/down cursor motions
moves at the right margin of each line.
The way window sizes and scrolling commands are based on the options
window and scroll has been rearranged. All command mode scrolling
commands (z and ctrl D) are based on scroll: ^D moves scroll lines,
z moves scroll*2 lines. Everything in visual (^D, ^U, ^F, ^B, z,
window sizes in general) are based on the window option. The
defaults are arranged so that everything seems as before, but
on hardcopy terminals at 300 baud the default for scroll is