Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!clyde!burl!ulysses!bellcore!whuxcc!lcuxlm!whuxl!houxm!hropus!jrw From: jrw@hropus.UUCP (Jim Webb) Newsgroups: net.bugs.usg,net.bugs.4bsd Subject: Re: vi bug? Message-ID: <659@hropus.UUCP> Date: Fri, 5-Sep-86 17:16:30 EDT Article-I.D.: hropus.659 Posted: Fri Sep 5 17:16:30 1986 Date-Received: Sat, 6-Sep-86 20:23:19 EDT References: <1178@ttrdc.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 32 Xref: mnetor net.bugs.usg:360 net.bugs.4bsd:916 > 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