NumUtils : calculator with regex support
| script karma
Downloaded by 272
Comments, bugs, improvements
script versions (upload new version)
Did you ever want to manipulate a lot of data in text files? Add an offset
to the axes in G-code, calculate the finances, or just renumber the
chapters in the table of contents? With this plugin you can do the
calculations with regular expression support!
Please feel free to send me a mail if you have a good idea, or found a
bug. If you think the plugin does something else that you want, send me
the lines to manipulate, the task that the plugin should do and the
command that you used for, and i try to find and fix the bug.
NumUtilsAdd, NumUtilsSub, NumUtilsMul, NumUtilsDiv
With the built-in commands you can do the basic stuff: addition,
subtraction, multiplication and division. By default the commands
will be called on the line where the cursor stays, but you can use
:range, :global, or linewise-visual to give a range as you do
when you using :subtitute for example.
A basic usage is for example add 10 to every number prefixed by X on this
X123 Y456 Z789 X100
To do it, call this:
:NumUtilsAdd 10, 'X'
... and you will get this:
X133 Y456 Z789 X110
Another example (add 2 to the number after star_ and to the number after
background: url(stars.png) no-repeat 0 0;
:NumUtilsAdd 2, 'star_!NUM!', ':NUM: !NUM!;$'
background: url(stars.png) no-repeat 0 2;
There is another useful feature (add first and second submatch to value of
:NumUtilsAdd [1,2], '\(:NUM:\)|\(:NUM:\)|!NUM!'
|Open in vim then run
... or use Vundle:
Add these lines to your .vimrc after 'call vundle#rc()':
Open vim again, then call ':PluginInstall'
Please rate if you using it!
Click on the package to download.
ip used for rating: 184.108.40.206