home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.editors
- Path: sparky!uunet!darwin.sura.net!wupost!uwm.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: <1992Jul21.224816.25122@news.acns.nwu.edu>
- Sender: usenet@news.acns.nwu.edu (Usenet on news.acns)
- Organization: Northwestern University, Evanston Illinois.
- References: <1992Jul19.023521.29749@tamsun.tamu.edu> <1992Jul20.211903.28367@news.acns.nwu.edu> <1992Jul20.233831.9582@sci.kun.nl>
- Date: Tue, 21 Jul 1992 22:48:16 GMT
- Lines: 37
-
- In article <1992Jul20.233831.9582@sci.kun.nl> hansm@cs.kun.nl (Hans Mulder) writes:
- >
- >:write " Just in case....
- >:set nowrapscan magic remap noignorecase
- >:map K n~Kq " The q stop vi from saying "No tail recursion".
-
- :map K nw~Kq "need the w to goto beginning of next word.
-
- >/[.!*] [ ]*[a-z]
-
- /[.!?*] [ ]*[a-z] "add '?' to the search pattern.
-
- >1GK
- >:unmap K " Too dangerous to leave it around.
- >:set wrapscan ignorecase " Whatever you like.
-
- " if you set ignorecase and reissue the
- command, then all changes will be undone
- (in case you didn't like it)
-
- 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.
-
- We have accomplished capitalizing the 'f' in followed when the sentence
- ends in [.!?] and there are one or more spaces after the punctuation. Now
- I would like to round this out and work on the lines which begin a
- sentence. Obviously, not all lines will begin a sentence, so I need some
- way to see if the last character on the previous line end in [.!?] (if so,
- do a ^~ to capitalize that first character).
-
- Any more ideas on this?
- -tms
-
-