home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / editors / 3018 < prev    next >
Encoding:
Text File  |  1992-12-11  |  1.6 KB  |  44 lines

  1. Newsgroups: comp.editors
  2. Path: sparky!uunet!mcsun!sun4nl!sci.kun.nl!cs.kun.nl!hansm
  3. From: hansm@cs.kun.nl (Hans Mulder)
  4. Subject: Re: VI macro question
  5. Message-ID: <Bz4EGH.EDu@sci.kun.nl>
  6. Sender: news@sci.kun.nl (News owner)
  7. Nntp-Posting-Host: zeus.cs.kun.nl
  8. Organization: University of Nijmegen, The Netherlands
  9. References: <1992Dec6.173757.14614@newssun.med.miami.edu> <1992Dec10.163025.2815@memex.co.uk>
  10. Date: Sat, 12 Dec 1992 00:24:17 GMT
  11. Lines: 31
  12.  
  13. In <1992Dec10.163025.2815@memex.co.uk> stephen@memex.co.uk (Stephen Marley) writes:
  14. >dnelson@newssun.med.miami.edu (Dru Nelson) writes:
  15. >:     When I tried using the #i macro:
  16. >: 
  17. >:     map! #i        #include <.h>hhha
  18. >: 
  19. >:     I always get #include <a.h> if I am in append mode.
  20. >:     or #include <li.h> when I am doing an insert in a line.
  21. >:     Or an insert at the begining causes this.  #include <i.h>
  22. >:     When I am in R or Overwrite I get this: #include <lR.h>
  23.  
  24. >    map! #i #include <.h>^[hh
  25.  
  26. >This doesn't need an 'a' to append since map! leaves you in the editing mode
  27. >you were in previously.
  28.  
  29. That's the problem: vi tries to get you back into the mode you were in by
  30. pretending you typed 'a' or 'li' or something, without noticing that you
  31. are in append mode already, so that the a or li or lR or whatever ends up
  32. being inserted as text.
  33.  
  34. Something comparable happens when you ":map r a" and then try to use '~':
  35. if the cursor sits on an 'x' and you type '~', vi pretends that you typed
  36. 'rX ', which does the right thing, unless you've :mapped 'r' or ' '.
  37.  
  38. Morale: don't :map any of "ailru$ \_".
  39.  
  40. --
  41. Hope this helps,
  42.  
  43. Hans Mulder                hansm@cs.kun.nl
  44.