I have a file with the following line:
img width="240" height="120"
I want to scale the width and height by the same amount so that
:%s/width="\\(.*\\)" height="\\(.*\\)"/width="2*\\1" height="2*\\2"/g
produces
img width="2*240" height="2*120"
anyway, to get vi to actually compute 2*240=480and put 480into the result.
thank you for your help.
source
share