René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

[VIM] Replacing text with the return value of a function

In VIM, when using the substitute command (:s), it is possible to call a function in the replace part of the :s command. This is the case when the replace part starts with a \=, like shown here
:s/REGEXP/\=SomeFunc()/
The following substitute replaces each character with the second next character in the alphabeth...
:%s/\(\w\)/\=nr2char(char2nr(submatch(1))+2)/g
... so, a
abcdef
... is turned into a
cdefgh