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

  1. Newsgroups: comp.editors
  2. Path: sparky!uunet!darwin.sura.net!wupost!uwm.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: <1992Jul21.224816.25122@news.acns.nwu.edu>
  6. Sender: usenet@news.acns.nwu.edu (Usenet on news.acns)
  7. Organization: Northwestern University, Evanston Illinois.
  8. References: <1992Jul19.023521.29749@tamsun.tamu.edu> <1992Jul20.211903.28367@news.acns.nwu.edu> <1992Jul20.233831.9582@sci.kun.nl>
  9. Date: Tue, 21 Jul 1992 22:48:16 GMT
  10. Lines: 37
  11.  
  12. In article <1992Jul20.233831.9582@sci.kun.nl> hansm@cs.kun.nl (Hans Mulder) writes:
  13. >
  14. >:write                " Just in case....
  15. >:set nowrapscan magic remap noignorecase
  16. >:map K n~Kq            " The q stop vi from saying "No tail recursion".
  17.  
  18.  :map K nw~Kq            "need the w to goto beginning of next word.
  19.  
  20. >/[.!*] [ ]*[a-z]
  21.  
  22.  /[.!?*] [ ]*[a-z]        "add '?' to the search pattern.
  23.  
  24. >1GK
  25. >:unmap K            " Too dangerous to leave it around.
  26. >:set wrapscan ignorecase    " Whatever you like.
  27.  
  28.                 " if you set ignorecase and reissue the
  29.                    command, then all changes will be undone
  30.                   (in case you didn't like it)
  31.  
  32. Now, onto phase 2:
  33.     So far, this is very good. The only problem I have now is getting
  34. sentences which begin a newline. For example.
  35.  
  36. this is a sentence on the current line[.!?] followed by another sentence[.!?]
  37. and here is the beginning of a new sentence on a new line.
  38.  
  39. We have accomplished capitalizing the 'f' in followed when the sentence 
  40. ends in [.!?] and there are one or more spaces after the punctuation. Now
  41. I would like to round this out and work on the lines which begin a
  42. sentence. Obviously, not all lines will begin a sentence, so I need some
  43. way to see if the last character on the previous line end in [.!?] (if so,
  44. do a ^~ to capitalize that first character).
  45.  
  46. Any more ideas on this?
  47. -tms
  48.  
  49.