Vi question

brian at bucc2.UUCP brian at bucc2.UUCP
Mon Mar 21 17:27:00 AEST 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 at seas.ucla.edu
  (309) 691-5175            ICBM: 40 40' N  89 34' W



More information about the Comp.unix.questions mailing list