Re: [vox-tech] ROT13 in vi?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vox-tech] ROT13 in vi?
* Mark Kim <mkkim@ucdavis.edu> [001116 02:53], about
> Re: [vox-tech] ROT13 in vi?:
:Actually, I wanted to know the way to do ROT-N, where N is any arbitrary
:number, including 13. Mike's way of doing it was using :tr but I can't
:figure it out. It was something like:
:
: :%tr/[A-Za-z]/[N-ZA-Mn-za-m]/g
Are you sure?
$ grep rot ~/.vimrc
:map rot :!tr A-Za-z N-ZA-Mn-za-m
Ohh.. lesse.. I understand now, you were using vi to do it, hmm.. vim help tr
doesn't seem to be the same as the unix tr command? (And I don't see a 'tr'
in the sed man page either. OHh wait, I do see a y/ command, but I don't
see that command in vi(m).)
The way I use this mapping in vim is to do a visual block, and just type
'rot'. I am unsure if this is supported in vi.. Okay, just did a
:%!tr A-Za-z N-ZA-Mn-za-m
and it seemed to work. (let's just say 'good enough' ;)
I don't remember exactly where I got this map from, but it must have been
from a vim page, since as I mentioned I use it with 'v' (visual blocks).
(hmm, was just trying to remember what the hoizontal block was but can't
offhand.)
HTH!
>-- End of excerpt from Mark Kim
Hmm, having trouble figuring out how to get your version of the expression
to work, would have to look at it later.. You're sure you're not thinking
perl or anything right? (Been playing with perl a little lately and the
differences in regexes, for example, I encountered.. annoying. Let's just
say that. (I wouldn't've guessed I supopse would be the problem..))
(just saw this as one of the last lines in my procmail log, so by
chance/randomness I got to see it.. ;)
-Aajay
Arg.. wrong sig chosen again, have my mutt send-hooks look for lug not
mother.. arg..
--
Milpitas, ca ajay@os2man.cjb.net HempVille, Planet Talarian
http://os2man.cjb.net/pictures/
"I'd rather be forgotten than remembered for giving in..."
|