I would like to increment the ASCII value of several rows of characters. Most of them are not alphanumeric, otherwise I could simply use :set nrformats+=alpha
to make CTRL-A
and CTRL-X
work on them. Is there any native Vim way of incrementing and decrementing ASCII values, or do I need to script it?
:help nr2char
:help char2nr
Example:
:%s/./\=nr2char(char2nr(submatch(0))+1)/g
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With