Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.editors Subject: Re: Is there a vi command to... Message-ID: <1991May10.195429.6025@convex.com> Date: 10 May 91 19:54:29 GMT References: <1991May09.160949.12305@convex.com> <1991May10.165948.9707@ssd.kodak.com> <1991May10.183236.16162@cbfsb.att.com> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: usa Organization: CONVEX Software Development, Richardson, TX Lines: 39 Nntp-Posting-Host: pixel.convex.com From the keyboard of rosen@cbnewsb.cb.att.com (steven.b.rosen): :In article <1991May10.165948.9707@ssd.kodak.com>, weimer@garden.ssd.kodak.com (Gary Weimer (253-7796)) writes: :> :> In article <1991May09.160949.12305@convex.com>, tchrist@convex.COM (Tom :> Christiansen) writes: :> |> From the keyboard of richt@meaddata.com (Rich Thompson): :> |> :Is there any command in VI which will execute a "~" on every :> |> :character on the current line to the right of the current :> |> :character? :> |> :> |> map = y$mno^V^[P:s/./\~/g^V^M0"nDdd`n@n : :Heres another way to skin this cat that I think is easier. : : :. s/./\u&/g : ^^^--------change every char (.) with the uppercase of . : : You can also do \l to flip to lower case. : Finally there is a whole bunch of things you do with the : "search string" such as.. : : :1,$ s/\<./\u&/g : ^^^--------find the char at the start of a word : and flip its case to upper. the problem with your solution is that you lose the cursor position and do it to the whole line. mine goes through contortions to maintain this. : :. s/./\u&/g that would be much more efficiently executed as :. s/.*/\U&/ --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "So much mail, so little time."