Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: 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 Xref: watmath net.micro.pc:8576 net.unix-wizards:18318 > ...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 ex:: or vi:: OR ei:: OR vx:: where the items represent possibly-null strings and the is another possibly-null string, it is a "mode line". The 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)