Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!rochester!cornell!batcomputer!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbfsb!cbnewsb.cb.att.com!rosen From: rosen@cbnewsb.cb.att.com (steven.b.rosen) Newsgroups: comp.editors Subject: Re: Is there a vi command to... Summary: Another way to flip case in vi (easier?) Message-ID: <1991May10.183236.16162@cbfsb.att.com> Date: 10 May 91 18:32:36 GMT References: <4279@meaddata.meaddata.com> <1991May09.160949.12305@convex.com> <1991May10.165948.9707@ssd.kodak.com> Sender: news@cbfsb.att.com Distribution: usa Organization: AT&T Bell Laboratories Lines: 32 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. ...steve... ---------------------------------------- Steve Rosen attmail!srosen srosen@attmail.com ----------------------------------------