home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / editors / 3016 < prev    next >
Encoding:
Internet Message Format  |  1992-12-11  |  2.2 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!uknet!strath-cs!memex!stephen
  2. From: stephen@memex.co.uk (Stephen Marley)
  3. Newsgroups: comp.editors
  4. Subject: Re: VI macro question
  5. Message-ID: <1992Dec10.163025.2815@memex.co.uk>
  6. Date: 10 Dec 92 16:30:25 GMT
  7. References: <1992Dec6.173757.14614@newssun.med.miami.edu>
  8. Organization: Memex Information Systems Ltd., East Kilbride, Scotland
  9. Lines: 51
  10. X-Newsreader: Tin 1.1 PL4
  11.  
  12. dnelson@newssun.med.miami.edu (Dru Nelson) writes:
  13.  
  14. :     When I tried using the #i macro:
  15. :     map! #i        #include <.h>hhha
  16. :     map! /*        /*  */hhi
  17. :     I always get #include <a.h> if I am in append mode.
  18. :     or #include <li.h> when I am doing an insert in a line.
  19. :     Or an insert at the begining causes this.  #include <i.h>
  20. :     When I am in R or Overwrite I get this: #include <lR.h>
  21.    ...
  22.  
  23. :     When I do a :map!  I get a :
  24. :     fi       #i        #include <.h>hhha
  25. :     What is this fi?
  26.  
  27. The # notation, in this context, is primarily for use in mapping
  28. function keys where #1 represents function_key 1.  If you map!
  29. something to #1, when you do a map! you will see something like,
  30.  
  31.     f1     ^[OP     what_you_mapped_to
  32.  
  33. where ^[OP is the termcap code for the F1 key for your terminal type
  34. ($TERM).  (This isn't necessarily what your F1 key generates - but
  35. that's another problem).  So when you see 'fi' this behaviour appears
  36. to be extended to 'function_key i'.  I suspect this, and the spurious i's
  37. or R's are indications of some bug. :-(
  38.  
  39. The good news though, is that behaviour you desire can be achieved with
  40. the following macro :-)
  41.  
  42.     map! #i #include <.h>^[hh
  43.  
  44. This doesn't need an 'a' to append since map! leaves you in the editing mode
  45. you were in previously.  However, the macro above only leaves the
  46. cursor in the right place when you start in insert (i), open (o), or
  47. replace (R) mode, but not append (a).  This is really quite easy to
  48. live with, though, since a typical sequence of keystrokes would be:
  49.  
  50.     i#istdio<esc>o#istdlib<esc>o            ...
  51.  
  52. Hope this helps.  
  53. --
  54. Stephen Marley
  55. Memex Information Systems Ltd., East Kilbride, G75 0YN, Scotland, UK. 
  56. stephen@memex.co.uk      Tel: (03552) 33804     Fax: (03552) 39676
  57.