🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3288

vi macros to convert the case of a word

#3288
From: Ewbank
Date: Tue, 06 Sep 1988 18:03
16 lines
974 bytes
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 <cntl>X in the sequences below, and :so the file into your
editor session.  This will map the <cntl>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 ===
Technical Details
Message-ID: <8686@ihlpb.ATT.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!peregrine!elroy!ames!ncar!tank!oddjob!gargoyle!att!ihlpb!bdewbank

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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