Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!ukc!its63b!simon From: simon@its63b.ed.ac.uk (Simon Brown) Newsgroups: comp.unix.wizards Subject: Re: Undocumented vi feature Message-ID: <491@its63b.ed.ac.uk> Date: Sun, 21-Jun-87 17:51:53 EDT Article-I.D.: its63b.491 Posted: Sun Jun 21 17:51:53 1987 Date-Received: Fri, 26-Jun-87 03:45:42 EDT References: <219@ausmelb.OZ> Reply-To: simon@its63b.ed.ac.uk (Simon Brown) Organization: Computer Science Department, Edinburgh University Lines: 31 Keywords: vi/ex commands in a text file In article <219@ausmelb.OZ> dak@ausmelb.OZ (David Kruger) writes: > >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? > What you do is you put lines containing things like vi: commands or ex: commands in the first five (or last 5) lines of the file. It doesn't matter whether you use vi or ex. The "vi:" or "ex:" needn't be at the start of the line, so that things like /* * vi: set nonumber nolist */ comments in your C-code will work. %{ Simon! %} -- ---------------------------------- | Simon Brown | UUCP: seismo!mcvax!ukc!its63b!simon | Department of Computer Science | JANET: simon@uk.ac.ed.its63b | University of Edinburgh, | ARPA: simon%its63b.ed.ac.uk@cs.ucl.ac.uk | Scotland, UK. | ---------------------------------- "Life's like that, you know"