vi bug?

Jim Webb jrw at hropus.UUCP
Sat Sep 6 07:16:30 AEST 1986


> I have found what I _think_ is a bug in several different versions of vi
  ....
> The trouble seems to be that vi will intercept certain ASCII sequences in
> the input file on lines beginning with 'ex:' and will interpret them as if
> they were commands.
> 
> Would someone who is in the know please tell me whether this behavior is
> a bug or a "feature"?  I certainly cannot find any mention of it in what
> little documentation I have about vi (the SysV and BSD man pages on ex and
> vi, and a document called "An Introduction to Display Editing using Vi").
> Thank you in advance.

This is an semi-documented feature:  

	Mode lines are now supported.  Put a line containing
		ex: xxx :
	in the first or last 5 lines of the file, where xxx is any ex
	command you want executed when that file is read in.  To make
	other programs happy, it should probably be inside a comment. ----+
	You can use vi: as well as ex:.  (Note: no space allowed          |
	between the "ex" and ":".  The spaces around xxx are considered   |
	part of the command, and so are optional.)                        |
                                                                          |
                                              eg /* ex: autoindent : */ <-+

It was added in version 3.7 (October 16, 1981).  This and other goodies
are found in a file ex.news which comes with the vi src.  On my machine,
it was in /usr/src/cmd/vi/vax/ex.news which is a vax running SVR2.  I don't
know whether or not it is considered proprietary, otherwise I would have
posted it in its entirety.
-- 
Jim Webb             "Out of phase--get help"          ...!ihnp4!hropus!jrw



More information about the Net.bugs.usg mailing list