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

  1. Newsgroups: comp.editors
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!casbah.acns.nwu.edu!navarra
  3. From: navarra@casbah.acns.nwu.edu (John Navarra)
  4. Subject: Re: Capitalizing first [a-z] letter in sentence in vi
  5. Message-ID: <1992Jul22.215752.19032@news.acns.nwu.edu>
  6. Sender: usenet@news.acns.nwu.edu (Usenet on news.acns)
  7. Organization: Northwestern University, Evanston Illinois.
  8. References: <1992Jul20.233831.9582@sci.kun.nl> <1992Jul21.224816.25122@news.acns.nwu.edu> <1992Jul22.141433.26865@sci.kun.nl>
  9. Date: Wed, 22 Jul 1992 21:57:52 GMT
  10. Lines: 31
  11.  
  12. In article <1992Jul22.141433.26865@sci.kun.nl> hansm@cs.kun.nl (Hans Mulder) writes:
  13. >>Now, onto phase 2:
  14. >>    So far, this is very good. The only problem I have now is getting
  15. >>sentences which begin a newline. For example.
  16. >
  17. >>this is a sentence on the current line[.!?] followed by another sentence[.!?]
  18. >>and here is the beginning of a new sentence on a new line.
  19. >
  20. >How about:
  21. >
  22. >:g/[.!?])*[ ]*$/+s/[a-z]/\u&
  23.  
  24.     I am not sure about this one. Can you explain it more? I am getting
  25. a "Not that many lines in buffer" error when I try it. 
  26.  
  27. >
  28. >For that matter,
  29. >
  30. >:%s/[.!?*])* [ ]*[a-z]/\U&/g
  31.  
  32.     This works great. One final suggestion for this substitution:
  33.  
  34. :%s/[.!?*])*[SPACETAB]*[a-z]/\U&/g
  35.  
  36. This will fix sentences separated by whitespace characters instead of those
  37. just separated by one or more spaces. 
  38.  
  39. Now, all I need is that beginning of sentence case and all will be well I
  40. think....
  41.  
  42. -tms
  43.