Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!mrspoc!itkin From: itkin@mrspoc.Transact.COM (Steven M. List) Newsgroups: comp.editors Subject: Re: Vi question Message-ID: <1989Oct17.203042.14712@mrspoc.Transact.COM> Date: 17 Oct 89 20:30:42 GMT References: <1494@bnlux0.bnl.gov> Reply-To: itkin@guinan.Transact.COM Organization: Transact Software, Inc. Lines: 34 como@max.bnl.gov (Andrew T. Como) writes: > I have a question about "vi"...If you are editing >a file and want to look at another file (just for reference) >is there a way? Yup - you can "edit" an alternate file with ":e filename". > Also how can I keep switching from file1 to file2 without >"setting autowrite". This is what's known as "editing an alternate file". The last file you edited in this VI session is known as "#". Thus, if you are editing file1 and file2: vi file1 file2 :n :e # :e # will first bring up file1, switch to file2, then switch back to file1. Each time you type ":e #" it switches to the last file you were editing. I define a macro in my .exrc for this: map ^A :e #^M since I do it so often. Since ^A is right by the little finger of my left hand, it's awfully easy to use. -- +----------------------------------------------------------------------------+ : Steven List @ Transact Software, Inc. :^>~ : : Chairman, Unify User Group of Northern California : : {apple,coherent,limbo,mips,pyramid,ubvax}!itkin@guinan.Transact.COM :