How do I increment or add to all numbers in a file using Vim substitution?
:%s/\d\+/\=submatch(0)+1/g
Vim's expression replacement (\=) in substitutions lets you perform arithmetic on matched text.
:%s/\d\+/\=submatch(0)+1/g
Vim's expression replacement (\=) in substitutions lets you perform arithmetic on matched text.