Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!pacbell!att-ih!ihnp4!inuxc!iuvax!pur-ee!uiucdcs!bradley!bucc2!brian From: brian@bucc2.UUCP Newsgroups: comp.unix.questions Subject: Re: Vi question Message-ID: <15100007@bucc2> Date: 21 Mar 88 07:27:00 GMT References: <499@n8emr.UUCP> Lines: 30 Nf-ID: #R:n8emr.UUCP:499:bucc2:15100007:000:1040 Nf-From: bucc2.UUCP!brian Mar 21 01:27:00 1988 > When I go into vi with two edit files specified, I sometimes would like to be > able to edit just the first and say "Write out these changes and get out of > the program all together". I tried writing a macro called Q which would do > a > :wq! > and that didnt work. > I then tried to get it to do: > :wq!\n:q! > and that didnt seem to work. Anyone have any more ideas? > Thanks! Try: map Q :wq!^VRETURN RETURN represents your enter key, be it marked newline, enter, return, or whatever. ^V represents control-V. Note this could be a dangerous macro to have set up. Note also that if you re-map Q to do this, you can't use Q to do what it normally does (go into ed-mode) without first unmapping Q. ............................................................................... When the going gets weird, the weird turn pro. Brian Michael Wendt UUCP: {cepu,ihnp4,uiucdcs,noao}!bradley!brian Bradley University ARPA: cepu!bradley!brian@seas.ucla.edu (309) 691-5175 ICBM: 40 40' N 89 34' W