Subject: Re: meta-control-bucky-vi
To: Peter Seebach <seebs@solon.com>
From: David Maxwell <david@spinne.web.net>
List: current-users
Date: 05/24/1995 10:22:05
> 
> Can anyone tell me how to tell vi to replace a character like, say,
> 0x92 (meta-ctrl-r) in vi?  Assume I *can't* type high-bit; 7-bit
> rlogin.  vi shows them as "0x92".  But they don't match "0x92".  Can
> I use something obvious like \x92?
> 
> -s
  
Vi wasn't really designed to be an 8-bit editor, you should be able to
get what you want by doing...

[range]!tr s1 s2

with appropriate variables. tr will let you use octal values if you preceed
them with a '\'. If you need Hex, put the following in your personal bin
directory as 'x'.

#! /bin/sh
echo -n \\
bc <<EOF
ibase=F
obase=8
print $1
EOF

Now you can do...

[range]!tr a `x E9`

All of this is pretty shell-independent - feel free to add aliases and vi 
macros to taste. :-)

							David Maxwell
							david@web.net