vi question - (nf)

davy at ecn-ee.UUCP davy at ecn-ee.UUCP
Thu Mar 22 03:29:37 AEST 1984


#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



More information about the Comp.unix mailing list