Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uakari.primate.wisc.edu!ames!amdahl!pacbell!att!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.editors Subject: Re: vi abbreviation for :w :n ? Summary: about aw Message-ID: <9652@chinet.chi.il.us> Date: 24 Sep 89 07:33:12 GMT References: <4728@tekcrl.LABS.TEK.COM> <26465@iuvax.cs.indiana.edu>Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Organization: Chinet - Public Access Unix Lines: 18 In article bitbug@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. If you use the ^^ command (that's control-caret), >the file will also be written when going to the alternate file. 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