home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!natinst.com!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!agate!linus!linus.mitre.org!ramirez!hargrove
- From: hargrove@ramirez.mitre.org (Paul H. Hargrove)
- Newsgroups: comp.editors
- Subject: Re: Capitalizing first [a-z] letter in sentence in vi
- Summary: works but not with map
- Message-ID: <1992Jul28.155141.9808@linus.mitre.org>
- Date: 28 Jul 92 15:51:41 GMT
- References: <1992Jul22.141433.26865@sci.kun.nl> <1992Jul22.215752.19032@news.acns.nwu.edu> <1992Jul23.010424.4048@sci.kun.nl>
- Sender: news@linus.mitre.org (News Service)
- Organization: Mitre Corporation, McLean, VA
- Lines: 24
- Originator: hargrove@ramirez
- Nntp-Posting-Host: ramirez.mitre.org
-
- In article <1992Jul23.010424.4048@sci.kun.nl> hansm@cs.kun.nl (Hans Mulder)
- writes:
- >:1,$-1g/[.!?])*[ ]*$/+s/[A-Za-z]/\u&
- [very good, piece by piece, explanation deleted]
- >--
- >Hope this helps,
- >
- >Hans Mulder hansm@cs.kun.nl
-
- As the person who asked the question noted, this works (but is better with
- [ ^I] than with just [ ]. It works if I _type_ it, but when I tried:
- :map q :1,$-1g/[.!?])*[ ^I]*$/+s/[A-Za-z]/\u&^V^M
- and hit 'q' I got a message than told me that undo was not permitted in
- globals. I also tried using
- :map q :g/[.!?])*[ ^I]*$//[A-Za-z]/s//\u&^V^M
- (which helps fix the first line if the last is properly punctuated and I have
- wrapscan set). This also fails with the 'no undo' message.
-
- I get the same result whether I type the map command or put it in my .exrc
- file (with the required ^V^V^V^M rather than ^V^M).
-
- Is there something I need to escape?
- --------
- Paul H. Hargrove, speaking for myself.
-