Xref: utzoo comp.unix.questions:18496 comp.unix.i386:1816 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mailrus!usenet.ins.cwru.edu!hal!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery) Newsgroups: comp.unix.questions,comp.unix.i386 Subject: Re: how do you get modeline(s) to work under vi? Message-ID: <1989Dec17.174535.22577@NCoast.ORG> Date: 17 Dec 89 17:45:35 GMT References: <493@hades.OZ> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery) Followup-To: comp.unix.questions Organization: North Coast Public Access UN*X, Cleveland, OH Lines: 39 As quoted from <493@hades.OZ> by greyham@hades.OZ (Greyham Stoney): +--------------- | Can anyone provide me with a working example of how to get modelines to | work under vi?. Our vi (ISC 386/ix) 'set all' shows a 'modelines' option; | (note that it's plural; the BSD manual I have says it's singular) but I | can't seem to get it to do anything. +--------------- "modelines" in vi doesn't mean something on the screen; it refers to the ability to put ex/vi commands in a file, to be executed when the file is read in. The commands must be in the first and/or last 5 lines in the file, prefixed by "[ev][xi]:" (that is, any of "ex:", "vi:", "vx:", or "ei:"), and be suffixed with a colon. ("ex: set autoindent:") (Don't worry, I'm going to make sure that the above isn't in the first/last 5 lines of this message.) This option is often disabled by default, since it can be somehting of a security hole. Perhaps what you want is the "showmode" option. This option makes the current mode show up in the lower right-hand corner of the screen; it's blank in command mode, or may show one of the following: APPEND MODE INSERT MODE CHANGE MODE REPLACE MODE REPLACE 1 CHAR There may be others as well. This goes a long way toward fixing the biggest problem with vi: knowing just exactly what it expects you to be doing. After all, you can botch things up royally if you think you're in an input mode and vi thinks you're in command mode. ++Brandon -- Brandon S. Allbery allbery@NCoast.ORG, BALLBERY (MCI Mail), ALLBERY (Delphi) uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu bsa@telotech.uucp *(comp.sources.misc mail to comp-sources-misc[-request]@backbone.site, please)* *Third party vote-collection service: send mail to allbery@uunet.uu.net (ONLY)* expnet.all: Experiments in *net management and organization. Mail me for info.