Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!mcnc!ge From: ge@mcnc.org (George Entenman) Newsgroups: comp.editors Subject: Re: autowrite (was: Re: vi abbreviation for :w :n ?) Message-ID: <5575@alvin.mcnc.org> Date: 10 Oct 89 16:29:59 GMT References: <4728@tekcrl.LABS.TEK.COM> <26465@iuvax.cs.indiana.edu> <5486@alvin.mcnc.org> <455@tuewsd.lso.win.tue.nl> <3627@solo5.cs.vu.nl> <3436@daimi.dk> Reply-To: ge@mcnc.org.UUCP (George Entenman) Organization: Microelectronics Center of NC; RTP, NC Lines: 36 In article <3436@daimi.dk> erja@daimi.DK (Erik Jacobsen) writes: >In article <3627@solo5.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: >>This is the way to go! Once you know how to use `autowrite', life with vi >>becomes so much simpler... >>From the Vi Reference: >>... >> aw | autowrite - Write at every shell escape. >> | (useful when compiling from within vi) >>... >> | `:map ^C :!cc %^V' to compile from within vi > >If you don't like autowrite you could do it: > > : map ^C :w!^V:!cc %^V > I do something very similar to avoid using autowrite. At the top of my C files, I have some lines that look like this (the ^M is entered by typing '^V'): /* :w^M:!cc -o file file.c */ Then I simply yank that line into a buffer (usually "c) and execute it whenever I need write and compile the file (@c). I must admit, however, that in a windowing environment, I have gotten used to writing the file and then moving to another window to compile and execute the program. So I don't escape from vi in any way. (Who knows why my officemate actually quits vi for each compilation????) ...................................................................... George Entenman ge@mcnc.org