vimtricks.wiki Concise Vim tricks, one at a time.

How do you use a function in the replacement of a substitution?

Answer

:%s/\d\+/\=submatch(0)*2/g

Explanation

Use \= to evaluate expressions. submatch(0) is the full match. This example doubles all numbers in the file.

Next

How do I visually select a double-quoted string including the quotes themselves?