MvtAssign It
Sublime Text Plugin to convert Toolkit, Toolbelt, and Sebenza Tools variable assignments into Miva's default mvt:assign
Details
Installs
- Total 182
- Win 118
- Mac 54
- Linux 10
| Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
MvtAssign It - Sublime Text Plugin
Sublime Text plugin allows you to convert Toolkit, Toolbelt, and Sebenza Tools variable assignments into Miva's default mvt:assign.
For Example
This:
<mvt:item name="toolkit" param="sassign|foo|bar" />
<mvt:item name="toolkit" param="vassign|foo|l.all_settings:bar" />
<mvt:item name="toolkit" param="mvassign|foo|'bar' $ '!'" />
<mvt:item name="ry_toolbelt" param="assign|g.foo|toupper('bar')" />
<mvt:item name="sebenzatools" param="var|foo|'bar'" />
Becomes:
<mvt:assign name="g.foo" value="'bar'" />
<mvt:assign name="g.foo" value="l.settings:bar" />
<mvt:assign name="g.foo" value="'bar' $ '!'" />
<mvt:assign name="g.foo" value="toupper('bar')" />
<mvt:assign name="g.foo" value="'bar'" />
Features
- Use keyboard shortcut:
Ctrl+Mwhile tags are selected - Automatically converts
l.all_settingsvariable references tol.settings - Convert multiple items at once
- Works with Sublime Text 2 & Sublime Text 3
- Works on:
- Toolkit
- sassign
<mvt:item name="toolkit" param="sassign|foo|bar" /> - vassign
<mvt:item name="toolkit" param="vassign|foo|l.all_settings:bar" /> - mvassign
<mvt:item name="toolkit" param="mvassign|foo|'bar' $ '!'" />
- sassign
- Toolbelt
- assign
<mvt:item name="ry_toolbelt" param="assign|g.foo|'bar'" />
- assign
- Sebenza Tools
- var
<mvt:item name="sebenzatools" param="var|foo|'bar'" />
- var
- Toolkit
Installation Instructions
via Package Control
Ctrl+Shft+Pto bring up the Command Palette- Select the, “Package Control: Install Package” option
- Search & select the, “MvtAssign It” package
via GitHub
- Clone or unzip this repo into your Sublime Text Packages directory:
C:\Users\YOUR_USERNAME\AppData\Roaming\Sublime Text 2\Packages. - You should now have a new directory:
C:\Users\YOUR_USERNAME\AppData\Roaming\Sublime Text 2\Packages\MvtAssignIt
Usage Instructions
- Select the toolkit item(s)
- Use keyboard shortcut
Crtl+M(orCtrl+Shft+Pto bring up the Command Palette and select the “MvtAssign It” option) - Voila, your item has been converted!
Why is this important?
Simply put, mvt:assign is faster.
Using the /benchmark/benchmark.mvt code I tested how long it would take to iterate through an mvt:while loop for N numbers of times. At the maximum recorded number (10,000) mvt:assign was roughly 20 seconds faster than Toolbelt & Sebenza Tools' assign and 25 seconds faster than Toolkit's mvassign!
| Iterations | mvt:assign | Toolbelt | Sebenza Tools | Toolkit |
|---|---|---|---|---|
| 1 | 0.000171 sec. | 0.000361 sec. | 0.000945 sec. | 0.000574 sec. |
| 10 | 0.000164 sec. | 0.001613 sec. | 0.002193 sec. | 0.001843 sec. |
| 100 | 0.000309 sec. | 0.018862 sec. | 0.027008 sec. | 0.022553 sec. |
| 1,000 | 0.001952 sec. | 0.135798 sec. | 0.166441 sec. | 0.184801 sec. |
| 10,000 | 0.021111 sec. | 1.313019 sec. | 1.656581 sec. | 1.675808 sec. |
| 100,000 | 0.232023 sec. | 20.041977 sec. | 21.763862 sec. | 25.186679 sec. |
| 1,000,000 | 1.956414 sec. | 3000* sec. | 3000* sec. | 3000* sec. |
* 5 min. timeout was reached
