Path: utzoo!attcan!uunet!peregrine!elroy!ames!ncar!tank!oddjob!gargoyle!att!ihlpb!bdewbank From: bdewbank@ihlpb.ATT.COM (Ewbank) Newsgroups: comp.editors Subject: vi macros to convert the case of a word Keywords: fun fun fun Message-ID: <8686@ihlpb.ATT.COM> Date: 6 Sep 88 18:03:28 GMT Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 16 Recently, there was a question about how to convert the case of a word in vi. Just for fun, I tried to write a macro...and succeeded! Convert ^X to X in the sequences below, and :so the file into your editor session. This will map the T key into the case conversion operation. Enjoy. --- start of macro --- map C : Macro to reverse the case of the word starting at current letter map ^T i^M^[Ea^M^[-y$Pa^M^[-:s/./\~/g^M"zd$+@z--4J --- end of macro --- -- Bryan Ewbank, AT&T Bell Labs, bdewbank@ihlpb.ATT.COM === the opinions included herein are mine, not my employer's ===