home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / editors / 1835 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  1.6 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!natinst.com!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!agate!linus!linus.mitre.org!ramirez!hargrove
  2. From: hargrove@ramirez.mitre.org (Paul H. Hargrove)
  3. Newsgroups: comp.editors
  4. Subject: Re: Capitalizing first [a-z] letter in sentence in vi
  5. Summary: works but not with map
  6. Message-ID: <1992Jul28.155141.9808@linus.mitre.org>
  7. Date: 28 Jul 92 15:51:41 GMT
  8. References: <1992Jul22.141433.26865@sci.kun.nl> <1992Jul22.215752.19032@news.acns.nwu.edu> <1992Jul23.010424.4048@sci.kun.nl>
  9. Sender: news@linus.mitre.org (News Service)
  10. Organization: Mitre Corporation, McLean, VA
  11. Lines: 24
  12. Originator: hargrove@ramirez
  13. Nntp-Posting-Host: ramirez.mitre.org
  14.  
  15. In article <1992Jul23.010424.4048@sci.kun.nl> hansm@cs.kun.nl (Hans Mulder)
  16.  writes:
  17. >:1,$-1g/[.!?])*[ ]*$/+s/[A-Za-z]/\u&
  18. [very good, piece by piece, explanation deleted]
  19. >--
  20. >Hope this helps,
  21. >
  22. >Hans Mulder                hansm@cs.kun.nl
  23.  
  24. As the person who asked the question noted, this works (but is better with
  25. [ ^I] than with just [ ].  It works if I _type_ it, but when I tried:
  26.     :map q :1,$-1g/[.!?])*[ ^I]*$/+s/[A-Za-z]/\u&^V^M
  27. and hit 'q' I got a message than told me that undo was not permitted in
  28. globals.  I also tried using
  29.     :map q :g/[.!?])*[ ^I]*$//[A-Za-z]/s//\u&^V^M
  30. (which helps fix the first line if the last is properly punctuated and I have
  31. wrapscan set).  This also fails with the 'no undo' message.
  32.  
  33. I get the same result whether I type the map command or put it in my .exrc
  34. file (with the required ^V^V^V^M rather than ^V^M).
  35.  
  36. Is there something I need to escape?
  37. --------
  38. Paul H. Hargrove, speaking for myself.
  39.