🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #6793

Re: VI Mode Lines - What are they?

#6793
From: guy
Date: Sat, 07 Jun 1986 04:12
46 lines
2133 bytes
> ...this included a feature called "mode lines".  The release notice
> stated that this was a feature implemented in PC/VI just as it is in
> AT&T's Version 3.9 of UNIX VI.
> 
> Now for the big question, what are mode lines?!?  Anyone out there
> running AT&T VI who can answer this?

"mode lines" are an alleged feature, present not only in the "vi" 3.9 which
comes with System V Release 2, but also in the "vi" 3.7 which comes with
4.2BSD.  (It's not really "AT&T" "vi", 3.7 comes with S5R1 and is almost
identical to the 3.7 that comes with 4.2, and 3.9 is a version that was
changed to use "terminfo" and had a few other things done to it.)

One of the first or last five lines of the file can be a "mode line".  If
this line is of the form

	<stuff>ex:<commands>:<stuff>

or

	<stuff>vi:<commands>:<stuff>

OR

	<stuff>ei:<commands>:<stuff>

OR

	<stuff>vx:<commands>:<stuff>

where the <stuff> items represent possibly-null strings and the <commands>
is another possibly-null string, it is a "mode line".  The <commands> part
of the first such line it finds is executed as an "ex" command when the file
is read.

What's that you say?  You have a user named "sex" whose password file entry
is at the end of "/etc/passwd", and you get strange error messages when you
"vi" the password file?  Three guesses why....

4.3BSD's "vi" has a variable called "modeline", which is off by default;
mode line checking is only done if it's on.  One hopes this will migrate
into S5's "vi".
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com (or guy@sun.arpa)
Technical Details
Message-ID: <3987@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!sun!guy
References: <28@datagen.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!sun!guy
From: guy@sun.UUCP
Newsgroups: net.micro.pc,net.unix-wizards
Subject: Re: VI Mode Lines - What are they?
Message-ID: <3987@sun.uucp>
Date: Sat, 7-Jun-86 00:12:22 EDT
Article-I.D.: sun.3987
Posted: Sat Jun  7 00:12:22 1986
Date-Received: Sun, 8-Jun-86 05:16:37 EDT
References: <28@datagen.UUCP>
Organization: Sun Microsystems, Inc.
Lines: 46