Newsgroups: comp.editors
Path: utzoo!sq!lee
From: lee@sq.sq.com (Liam R. E. Quin)
Subject: Re: vi question (changing the CaSe of a word)
Message-ID: <1990Sep11.162658.3504@sq.sq.com>
Organization: SoftQuad Inc.
References: <2112@bnlux0.bnl.gov>
Date: Tue, 11 Sep 90 16:26:58 GMT
Lines: 22

como@max.bnl.gov (Andrew T. Como) writes:
>Is there a way to change a word case....(ie...from lower to upper)
Some versions of vi let you say ~w to do this.

You can also make a macro using \U and \L, except that \L is broken in
SunOS vi. Here is a version using \U to make an uppercase word.
   :map! ^B ^V^V ^V^[bywPbi:s/!\(^V^[els\)/\U\1/!^V^[F:"zd3f/@z^V^M
(You have to turn ^B into control-B, etc. first)
If you put this in your .exrc, you can delete the first ^V if you want.

This macro is inelegant in that it uses replace, and also uses f and F,
so it affects the , and ; commands.  You can't quite undo it (you get
a spurious ! left over), and it clobbers the & command too.  But it
is easier than typing...

Another way would be to use !w, but that doesn't work :-( :-(

Lee

-- 
Liam R. E. Quin,  lee@sq.com, SoftQuad Inc., Toronto, +1 (416) 963-8337
/text/humour/quote: No such file or directory
