Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site pur-ee.UUCP Path: utzoo!watmath!clyde!floyd!harpo!ihnp4!inuxc!pur-ee!ecn-ee!davy From: davy@ecn-ee.UUCP Newsgroups: net.unix Subject: Re: vi question - (nf) Message-ID: <1707@pur-ee.UUCP> Date: Wed, 21-Mar-84 12:29:37 EST Article-I.D.: pur-ee.1707 Posted: Wed Mar 21 12:29:37 1984 Date-Received: Thu, 22-Mar-84 04:19:46 EST Sender: notes@pur-ee.UUCP Organization: Electrical Engineering Department , Purdue University Lines: 38 #R:houxz:-71000:ecn-ee:17100004:000:990 ecn-ee!davy Mar 21 08:38:00 1984 There's an easier way: % vi file1 ..... ..... :w -- write out file1 :e file2 -- edit file2 ..... ..... :w -- write out file2 :e # -- go back to file1 There are advantages to this. First, you don't have to fork a shell to edit the second file. Secondly, by using ":e", all your named buffers stay the same across the edit. Thus, you can edit file1, go into file2, yank some stuff into a named buffer (e.g., "a10Y), go back to file1 by saying ":e #", and then put the text you just yanked (e.g. "ap). Some things to note: 1. Your unnamed buffers (last delete, etc.) are NOT saved between the two files. 2. If, from file2, you do another ":e", then ":e #" will take you back to file2. If you want to get back to file1, you'll have to ":e file1" again. This is because ":e #" always says "take me back to the previous file". 3. The HOME key used to be a synonym for ":e #", but this seems to have gone away in 4.2BSD. --Dave Curry pur-ee!davy