Did you know Vim has a built-in shortcut to ROT13-encode the current line? Me neither! And I've been using Vim for 13 years!
You can ROT13-encode the current line by typing g?? in Normal mode. I found
out about this while reading :help g (2.4 Commands starting with 'g').
1
Apparently, this feature has been in Vim since version 5.4, which came out in 1999. 2 For reference, Vim was first released in 1991, and is currently on version 9.2, which was released this year (2026). It's pretty astounding to me how old Vim is, especially considering development is still ongoing.
Digging a bit deeper, g?? is actually a special case. The more generalized
operator is g?. Just like with other operators like y (yank) or >
(indent), you can combine this with arbitrary motions to apply the operation
more precisely. For example, g?iw applies the operation to just the current
word.
Even though it's easy enough to shell out to another program or tool to do this, it's nice to be able to do it without leaving the editor. Plus, being able to apply the operation selectively is a nice bonus, since you might be working with a document that has ROT13-encoded text interspersed with cleartext.
g? is one of several operators that start with 'g'. For instance, you may be
familiar with g?'s more practical cousin, the formatting operator gq.
Tb sbegu naq ebgngr!