Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!sri-unix!sri-spam!mordor!lll-tis!elxsi!beatnix!gww From: gww@beatnix.UUCP Newsgroups: comp.unix.wizards Subject: Re: Undocumented vi feature Message-ID: <427@elxsi.UUCP> Date: Fri, 19-Jun-87 14:01:29 EDT Article-I.D.: elxsi.427 Posted: Fri Jun 19 14:01:29 1987 Date-Received: Sat, 20-Jun-87 09:23:01 EDT References: <219@ausmelb.OZ> Sender: nobody@elxsi.UUCP Reply-To: gww@beatnix.UUCP (Gary Winiger) Organization: ELXSI Super Computers, San Jose Lines: 29 Keywords: vi/ex commands in a text file In article <219@ausmelb.OZ> dak@ausmelb.OZ (David Kruger) writes: >I usually use vi with the number and list (ex) options set. I accomplish >this by putting the commands in my .exrc file. > > >A UNIX guru once told me that it is possible to somehow enter vi/ex commands at >the top of a text file so that when you `vi' the file, the commands are >executed. Does anybody out there know how to do it? This is a vagely documented feature :-} /usr/src/ucb/ex/ex.news reads in part: ``Version 3.7 October 16, 1981 Mode lines are now supported. Put a line containing ex: xxx : in the first or last 5 lines of the file, where xxx is any ex command you want executed when that file is read in. To make other programs happy, it should probably be inside a comment. You can use vi: as well as ex:. (Note: no space allowed between the "ex" and ":". The spaces around xxx are considered part of the command, and so are optional.) '' I thought this had also made its way into some of the ex/vi documentation, but I can't seem to find it now. Hope this answers your question. Gary.. {ucbvax!sun,lll-lcc!lll-tis,amdahl!altos86}!elxsi!gww