Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!psuvax1!gatech!mcnc!ge From: ge@mcnc.org (George Entenman) Newsgroups: comp.editors Subject: Re: vi abbreviation for :w :n ? Message-ID: <5486@alvin.mcnc.org> Date: 28 Sep 89 17:09:13 GMT References: <4728@tekcrl.LABS.TEK.COM> <26465@iuvax.cs.indiana.edu>Reply-To: ge@mcnc.org.UUCP (George Entenman) Organization: Microelectronics Center of NC; RTP, NC Lines: 46 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. My office mate typically codes C by using the following loop: repeat until satisfied with result invoke vi on a C file edit the file write the file quit vi compile But one day a couple of weeks ago, she started up vi on a C file and then used control-Z to stop it. She then started her typical work loop and worked for about 3 hours, making extensive changes on the original C file. After finishing, she noticed a vi job sitting in background and typed 'fg'. Seeing that the file was a very old version, she typed ':q' to get out. 3 hours of work were gone! There was lots of screaming that I won't describe here. It turned out that her .login file, which she had borrowed from someone, set EXINIT to autowrite. I don't think that autowrite should ever be set automatically. But then, I always alias 'rm' to be 'rm -i'. If I can't trust me, should you? ################################################################################ # # # George Entenman (ge@mcnc.org) # # # # The Microelectronics Center of North Carolina # # P.O. Box 12889 # # Research Triangle Park, NC 27709 # # 919/248-1953 # # # ################################################################################