Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rlgvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.unix,net.text Subject: Re: can vi/ex source beginning of text on startup? Message-ID: <288@rlgvax.UUCP> Date: Sat, 8-Dec-84 00:39:31 EST Article-I.D.: rlgvax.288 Posted: Sat Dec 8 00:39:31 1984 Date-Received: Sun, 9-Dec-84 03:18:58 EST References: <31@politik.UUCP> <107@bigtuna.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 27 Xref: watmath net.unix:3054 net.text:293 > > I recall seeing a text file with ex commands at the beginning, e.g. > > > > (some characters):set wrapmargin=10 > > > > It seemed like ex was meant to source the lines when starting up. > > Does this work and is it documented? > > Sure, it works, but I don't know where it's documented. It's not documented anywhere, for which the author apologized a while ago. > Basically, what you want to do is to automatically initialize your editing > environment whenever you invoke vi. The intent of this feature (those lines are called "mode lines") was to permit the initial ex/vi environment to be dependent on the file you're editing. A laudable goal, I guess (I use neither "vi", which has mode lines in the 3.7 release, nor "emacs", which I believe permits you to do this kind of initializing based on the file type, i.e. on the last component of the file name, like ".c", ".s", etc., and my favorite editor has no modes to be set) but it can trap the unwary. A long time ago, somebody posted changes to make this feature disabled by default and requiring you to set the "modelines" flag to enable it; it sounds like this is the right way to go and it's what we've done on our systems. Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy