home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.editors
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!casbah.acns.nwu.edu!navarra
- From: navarra@casbah.acns.nwu.edu (John Navarra)
- Subject: Re: Capitalizing first [a-z] letter in sentence in vi
- Message-ID: <1992Jul22.215752.19032@news.acns.nwu.edu>
- Sender: usenet@news.acns.nwu.edu (Usenet on news.acns)
- Organization: Northwestern University, Evanston Illinois.
- References: <1992Jul20.233831.9582@sci.kun.nl> <1992Jul21.224816.25122@news.acns.nwu.edu> <1992Jul22.141433.26865@sci.kun.nl>
- Date: Wed, 22 Jul 1992 21:57:52 GMT
- Lines: 31
-
- In article <1992Jul22.141433.26865@sci.kun.nl> hansm@cs.kun.nl (Hans Mulder) writes:
- >>Now, onto phase 2:
- >> So far, this is very good. The only problem I have now is getting
- >>sentences which begin a newline. For example.
- >
- >>this is a sentence on the current line[.!?] followed by another sentence[.!?]
- >>and here is the beginning of a new sentence on a new line.
- >
- >How about:
- >
- >:g/[.!?])*[ ]*$/+s/[a-z]/\u&
-
- I am not sure about this one. Can you explain it more? I am getting
- a "Not that many lines in buffer" error when I try it.
-
- >
- >For that matter,
- >
- >:%s/[.!?*])* [ ]*[a-z]/\U&/g
-
- This works great. One final suggestion for this substitution:
-
- :%s/[.!?*])*[SPACETAB]*[a-z]/\U&/g
-
- This will fix sentences separated by whitespace characters instead of those
- just separated by one or more spaces.
-
- Now, all I need is that beginning of sentence case and all will be well I
- think....
-
- -tms
-