Xref: utzoo comp.unix.questions:18533 comp.unix.i386:1866 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!inpnms!logan From: logan@inpnms.UUCP (Jim Logan) Newsgroups: comp.unix.questions,comp.unix.i386 Subject: Re: how do you get modeline(s) to work under vi? Message-ID: <223@inpnms.UUCP> Date: 20 Dec 89 02:16:19 GMT References: <493@hades.OZ> Reply-To: logan@inpnms.UUCP (Jim Logan) Organization: Data General Telecommunications, Rockville, MD Lines: 33 In article <493@hades.OZ> greyham@hades.OZ (Greyham Stoney) writes: # 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. I played with this for a good hour one day, and I would imagine that others would like to see how it is done; hence the post. You're right, there is nothing in the man page that describes modelines. All you have to do is put the line "set modelines" in $HOME/.exrc and put a line like "ex: set some_flags:" near the top or bottom of the file. A word of warning: When modelines are used, it changes the files status to modified. This makes it a real pain to switch back and forth between files since you have to explicitly type ":e!#" rather than being able press -^. It is also a problem when looking at source code. When you use vi to look at a file, you have to explicitly type ":q!" to get out of it. You can't use "ZZ" because it will cause "make" to recompile when there is no need. I used it for a while at the top of header files developed here with 3-space tabs. You could turn off "warn" or map "ZZ" to ":q!", but it's too easy to have an accident that way. -Jim -- James Logan UUCP: uunet!inpnms!logan Data General Telecommunications Inet: logan%inpnms@uunet.uu.net (301) 590-3069