Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!necntc!ci-dandelion!ulowell!hawk.CS.Ulowell.Edu!lavallee From: lavallee@hawk.CS.ULowell.Edu (Warren J. Lavallee) Newsgroups: comp.unix.wizards Subject: Re: Undocumented vi feature Message-ID: <1410@ulowell.cs.ulowell.edu> Date: Fri, 19-Jun-87 00:30:33 EDT Article-I.D.: ulowell.1410 Posted: Fri Jun 19 00:30:33 1987 Date-Received: Mon, 22-Jun-87 01:18:15 EDT References: <219@ausmelb.OZ> Sender: nobody@ulowell.cs.ulowell.edu Reply-To: lavallee@hawk.CS.ULowell.Edu (Warren J. Lavallee) Organization: University of Lowell Lines: 24 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? >Dave Kruger If you put a line in the format: (This worked on a BSD4.2 system at my last job. It does not work under Dynix 2.1. I considered it a bug anyways. :-) ) vi:commands or ex:commands fairly near the top (I think it is 10 lines), vi will execute the commands before you start editing the file. vi:q! makes a file virtually uneditable via vi. Warren Lavallee lavallee@ulowell.{csnet,UUCP}