home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / editors / 1807 < prev    next >
Encoding:
Text File  |  1992-07-23  |  1.6 KB  |  45 lines

  1. Newsgroups: comp.editors
  2. Path: sparky!uunet!mcsun!sun4nl!wn1.sci.kun.nl!cs.kun.nl!hansm
  3. From: hansm@cs.kun.nl (Hans Mulder)
  4. Subject: Re: Capitalizing first [a-z] letter in sentence in vi
  5. Message-ID: <1992Jul23.135305.2389@sci.kun.nl>
  6. Sender: news@sci.kun.nl (NUnet News Owner)
  7. Organization: University of Nijmegen, The Netherlands
  8. References: <1992Jul22.141433.26865@sci.kun.nl> <1992Jul22.215752.19032@news.acns.nwu.edu> <1992Jul23.010424.4048@sci.kun.nl> <1992Jul23.102852.1466@news.acns.nwu.edu>
  9. Date: Thu, 23 Jul 1992 13:53:05 GMT
  10. Lines: 33
  11.  
  12. In <1992Jul23.102852.1466@news.acns.nwu.edu> navarra@casbah.acns.nwu.edu (John Navarra) writes:
  13. >In article <1992Jul23.010424.4048@sci.kun.nl> I wrote:
  14. >>:1,$-1g/[.!?])*[ ]*$/+s/[A-Za-z]/\u&
  15. >     The only instances where this misses, that I can see, are as
  16. >follows:
  17.  
  18. >1) It misses the first line because there is no punctutation before the
  19. >   first sentence.
  20.  
  21. >2) It misses instances where there are blank lines in between two 
  22. >   sentences.
  23.  
  24. OK, fourth attempt:
  25.  
  26. :g/[.!?])*[SPACETAB]*$//[A-Za-z]/s//\u&
  27.  
  28. I.e. replace the + ("next line") by a search for a line that actually
  29. has a letter on it.  This obviously soves problem 2.  If you have the
  30. wrapscan option set, it also solves your first line problem, plus the
  31. "Not that many lines in buffer" problem in your previous post.
  32.  
  33. Incidentally, in this sort of construct the pattern to the left of
  34. the s/// is the default for its first argument.
  35.  
  36. >Getting tired of this yet? ;-(
  37.  
  38. Well, I'm going on holiday tomorrow; so it may take a while before
  39. you see my next attempt.
  40.  
  41. --
  42. Hope this helps,
  43.  
  44. Hans Mulder            hansm@cs.kun.nl
  45.