Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!ucsd!ucbvax!hplabs!hpda!hpcupt1!hpsal2!morrell From: morrell@hpsal2.HP.COM (Michael Morrell) Newsgroups: comp.editors Subject: Re: vi abbreviation for :w :n ? Message-ID: <8230002@hpsal2.HP.COM> Date: 25 Sep 89 18:42:03 GMT References: <4728@tekcrl.LABS.TEK.COM> Organization: HP System Architecture Lab, Cupertino Lines: 25 / hpsal2:comp.editors / les@chinet.chi.il.us (Leslie Mikesell) / 12:33 am Sep 24, 1989 / In articlebitbug@lonewolf.sun.com (James Buster) writes: >There is a much better way. Set autowrite (the "aw" variable) in your >EXINIT environment variable or .exrc. This will cause the file to be >automatically written when the :n command is given. If you have job >control, it will also cause your file to be written automatically >when ^Z is typed. Keep in mind that aw also causes a the file to be automatically written when you do a shell escape. I have been bitten by this a few times when I realized during an editing session that I had made substantial changes and should have made a backup copy of the original. No problem, just: :!cp % %.O except that with autowrite enabled, the current buffer is written out before the shell escape, so goodbye original file... Les Mikesell ---------- I agree with Les. It's too easy to be bitten by the autowrite "feature". I also have a map (I map ^N to :w^M:n^M) and it works great. Michael