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

  1. Newsgroups: comp.editors
  2. Path: sparky!uunet!utcsri!torn!cunews!nrcnet0!bnrgate!bcars267!news
  3. From: Reg Foulkes
  4. Subject: Re: Capitalizing first [a-z] letter in sentence in vi
  5. Message-ID: <1992Jul23.131525.19369@bnr.ca>
  6. Sender: news@bnr.ca (usenet)
  7. Nntp-Posting-Host: bpinm17
  8. Organization: Bell-Northern Research
  9. References: <1992Jul20.233831.9582@sci.kun.nl> <1992Jul21.224816.25122@news.acns.nwu.edu> <1992Jul22.141433.26865@sci.kun.nl> <1992Jul22.215752.19032@news.acns.nwu.edu> <1992Jul23.010424.4048@sci.kun.nl>
  10. Date: Thu, 23 Jul 1992 13:15:25 GMT
  11. Lines: 33
  12.  
  13. In article <1992Jul23.010424.4048@sci.kun.nl> hansm@cs.kun.nl (Hans Mulder)
  14. writes:
  15.  
  16. >It dissects as follows:
  17. >
  18. >:        Means that it's an ex command.
  19. >1,$-1        The range of lines it must be applied to: from the first till
  20. >        the second last.  Your problem is that the last line ends
  21. >        in one of [.!?] and you can't ~ the first char of the last
  22. >        line +1, because there are "Not that many lines in buffer".
  23. >g        Short for global.  Applies the +s/[a-z]/\u& command to all
  24. >        lines matching the pattern /[.!?])*[ ]*$/.
  25. >/[.!?])*[ ]*$/     Pattern for lines ending in one of [.!?], possibly some )
  26. >        and white space.  Add a tab between the [] if necessary.
  27. >+        Short for .+1 i.e. apply the s/// bit to the next line
  28. >s/[A-Za-z]/    Replace the first letter...
  29. >\u        ...by upper case of version of...
  30. >&        ...whatever matched the first argument.
  31. >
  32. >In the second argument of the s/// command, the magic sequence \u changes
  33. >the next letter to upper case, \U changes everything to upper case until
  34. >the next \e or \l or whatever.  The lower case versions are \l and \L.
  35. >
  36. >--
  37. >Hope this helps,
  38.  
  39.   Hans, 
  40.        What a beautiful piece of work. Care to write a book on vi?
  41.  
  42. --------------------------------
  43. Reg Foulkes                             Bell-Northern Research
  44. riskit@x400gate.bnr.ca           2745 Iris Street
  45. Telephone :(613) 763-4131     Ottawa, Ontario., Canada  K1Y 4H7
  46.