Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!mayoff From: mayoff@cs.utexas.edu (Robert Mayoff) Newsgroups: comp.editors Subject: Re: Change cases in VI Message-ID: <1023@cash.cs.utexas.edu> Date: 11 Dec 90 20:39:50 GMT References: <1990Dec11.005842.13795@pa.dec.com> Distribution: na Organization: Dept of Computer Sciences, UTexas, Austin Lines: 26 In article <1990Dec11.005842.13795@pa.dec.com> reader@wsl.dec.com (News Reader) writes: >Is there an easy way to change the whole file from upper case to lower case or >vice versa? Yes. The editor-only way to do it is to use this substitution command: :%s/.*/\L&/ but I prefer the (IMHO) less-cryptic, easier-to-remember, although slightly slower, solution: :%!tr A-Z a-z which uses the tr (translate) command to turn uppercase into lowercase. The reverse transformation can be accomplished with :%s/.*/\U&/ or :%!tr a-z A-Z -- /_ rob /_ Fun things to do with UNIX (#2 in a series): / echo "rsh `hostname` -n source eat.cpu &" > eat.cpu; source eat.cpu