Article View: comp.editors
Article #2493Re: VI macro question
From: Hans Mulder
Date: Sat, 12 Dec 1992 00:24
Date: Sat, 12 Dec 1992 00:24
31 lines
1657 bytes
1657 bytes
In <1992Dec10.163025.2815@memex.co.uk> stephen@memex.co.uk (Stephen Marley) writes: >dnelson@newssun.med.miami.edu (Dru Nelson) writes: >: When I tried using the #i macro: >: >: map! #i #include <.h>hhha >: >: I always get #include <a.h> if I am in append mode. >: or #include <li.h> when I am doing an insert in a line. >: Or an insert at the begining causes this. #include <i.h> >: When I am in R or Overwrite I get this: #include <lR.h> > map! #i #include <.h>^[hh >This doesn't need an 'a' to append since map! leaves you in the editing mode >you were in previously. That's the problem: vi tries to get you back into the mode you were in by pretending you typed 'a' or 'li' or something, without noticing that you are in append mode already, so that the a or li or lR or whatever ends up being inserted as text. Something comparable happens when you ":map r a" and then try to use '~': if the cursor sits on an 'x' and you type '~', vi pretends that you typed 'rX ', which does the right thing, unless you've :mapped 'r' or ' '. Morale: don't :map any of "ailru$ \_". -- Hope this helps, Hans Mulder hansm@cs.kun.nl
Technical Details
Message-ID:
<Bz4EGH.EDu@sci.kun.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!sci.kun.nl!cs.kun.nl!hansmReferences:
<1992Dec6.173757.14614@newssun.med.miami.edu> <1992Dec10.163025.2815@memex.co.uk>Show Full Headers
Complete Article Headers
Newsgroups: comp.editors Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!sci.kun.nl!cs.kun.nl!hansm From: hansm@cs.kun.nl (Hans Mulder) Subject: Re: VI macro question Message-ID: <Bz4EGH.EDu@sci.kun.nl> Sender: news@sci.kun.nl (News owner) Nntp-Posting-Host: zeus.cs.kun.nl Organization: University of Nijmegen, The Netherlands References: <1992Dec6.173757.14614@newssun.med.miami.edu> <1992Dec10.163025.2815@memex.co.uk> Date: Sat, 12 Dec 1992 00:24:17 GMT Lines: 31