In this note I just want to briefly talk about an amazing and ever so useful vim feature: yes, vim can encode and decode rot13! Just it can, out of the box! I know you can't believe it, so let me just show you how: The command is (in normal mode)
g?
followed by a movement. This will encode (or decode) the portion between the cursor and the endpoint defined by the movement.
For example, I have this stupid message to decode:
N shaal ivz srngher: ebg13
and I really want to know what it means. It's probably very important. So I just copy it on a line in vim and then (in normal mode) type
g?ip
(you know the movement ip
, right? if not, try :h v_ip
) and I obtain the decoded message!!! It's amazing, and it was really important, indeed!
Purref!
Amazing! Thanks so much for this tip!
ReplyDeleteg?? would be quicker (it's what I did before reading the article: "+Pg??)
ReplyDeleteThanks for your comment. You're right it's quicker. I just wanted to mention the lesser known motion `i` something (inner).
Delete