Path: utzoo!attcan!uunet!ginosko!brutus.cs.uiuc.edu!apple!sun-barr!newstop!sun!bitbug From: bitbug@lonewolf.sun.com (James Buster) Newsgroups: comp.editors Subject: Re: vi abbreviation for :w :n ? Message-ID: Date: 23 Sep 89 01:31:11 GMT References: <4728@tekcrl.LABS.TEK.COM> <26465@iuvax.cs.indiana.edu> Sender: news@sun.Eng.Sun.COM Organization: Sun Microsystems Federal, Inc. Lines: 35 In-reply-to: kinzler@iuvax.cs.indiana.edu's message of 23 Sep 89 00:19:17 GMT In article <26465@iuvax.cs.indiana.edu> kinzler@iuvax.cs.indiana.edu (Stephen Kinzler) writes: >>scott@tekcrl.LABS.TEK.COM (Scott Huddleston) writes: >>When editing multiple files in vi, I'd like a faster(*) way to write >>changes and move on to the next file than :w RETURN :n RETURN or >>ZZ:n RETURN. Is there a faster way? Thanx in advance. > >This is pretty much what macros were made for. Here's mine: > > map q :w^M:n^M > (the ^M's are really carriage returns, prefaced with ctrl-v) > >Put this in your EXINIT environment variable or your ~/.exrc file. 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. >------------------------------------------------------------------------ >| ., >{~) ['} / Stephen Kinzler \ + < : ~$[~{}== | >| % > %()}@! ' / kinzler@iuvax.cs.indiana.edu \ '}~{ >' & )<} | >| <@"??{.,'} / {ames,rutgers,att}!iuvax!kinzler \ &"(&@+}<+;@) | >| ])"} +{) / Indiana Univ Dept of Computer Science \ @ }[^??^&. | >------------------------------------------------------------------------ -- -------------------------------------------- James Buster Mad Hacker Extraordinaire bitbug@lonewolf.ebay.sun.com bitbug%lonewolf@sun.com sun.com!lonewolf!bitbug --------------------------------------------