How can I increase / decrease non-alphanumeric values ​​of ASCII characters in Vim?

I would like to increase the ASCII value of a few lines of characters. Most of them are not alphanumeric, otherwise I could just use :set nrformats+=alphato make CTRL-Aand CTRL-Xwork with them . Is there any Vim native way to increase and decrease ASCII values, or do I need a script it?

+5
source share
1 answer
:help nr2char
:help char2nr

Example:

:%s/./\=nr2char(char2nr(submatch(0))+1)/g
+4
source

All Articles