Sublime Forum

Inc-Dec-Value (ST2 and ST3)

#5

Possibly the most useful plugin (and in such simple code) I’ve ever used.

Awesome :smiley:

0 Likes

#6

[quote=“jbrooksuk”]Possibly the most useful plugin (and in such simple code) I’ve ever used.

Awesome :smiley:[/quote]

for the hex color code will be a little harder :unamused:

0 Likes

#7

Something like this could be helpful as alt+up/down jumps to the beginning/end of the line on os x:

[code]{ “keys”: “alt+up”], “command”: “inc_dec_number”, “args”: { “delta”: 1}, “context”:

  { "key": "preceding_text", "operator": "regex_contains", "operand": "[0-9]+" }
]

}[/code]

I am sure there is a better solution for the context but just for the idea.

0 Likes

#8

UPDATE: added support for hex color

0 Likes

#9

UPDATE: Added ability to change some values ​​(true/false, left/right) on opposite.

0 Likes

#10

UPDATE: Added ability to change some floating-point values.

0 Likes

#11

Inc-Dec-Value: moved to a separate repository github.com/rmaksim/Sublime-Text-2-Inc-Dec-Value

0 Likes

#12

UPDATE: Support dates in ISO format “YYYY-MM-DD”

The increase in year / month / day is its own, without checking the validity of the resulting date.
For days, the value of loops between 1 and 31, for months - loops between 1 and 12.

0 Likes

#13

UPDATE: BONUS - string actions - uppercase/lowercase/capitalize

Pressing the key alt+up makes the first letter in the word in Uppercase (Capitalize) without affecting the remaining characters.
Pressing the key super+up makes the word in UPPERCASE.
Pressing the key alt+down or super+down makes the word in lowercase.

0 Likes

#14

Nice plugin, thanks for sharing.

Could you put it in the Package Control repository to simplify the installation and make it more visible for the users ?

0 Likes

#15

[quote=“bizoo”]Nice plugin, thanks for sharing.

Could you put it in the Package Control repository to simplify the installation and make it more visible for the users ?[/quote]

“PackageControl” - I have not used it yet. It’s really good?
I’m still doing everything manually.

0 Likes

#16

[quote=“rmaksim”]
“PackageControl” - I have not used it yet. It’s really good?
I’m still doing everything manually.[/quote]

Yep, it really make life easier, especially for the automatic update of the plugins.

Simply clone the repository (https://github.com/wbond/package_control_channel), add your plugin and send a pull request.
You could also put a link to github/bitbucket in the Packages\User\Package Control.sublime-settings for plugins not in the central repository (what I’ve done for your plugin and a few others).

0 Likes

#17

+1 for adding this to Package Control (This would really help to discover this nice plugin for potential users - https://forum.sublimetext.com/t/plugin-idea-number-adder-substracter/3211/1)

0 Likes

#18

This plugin is totally awesome. Thank you very very much!

0 Likes

#19

I sent pull request github.com/wbond/package_contro … el/pull/42
Probably have to wait a bit.

0 Likes

#20

UPDATE: v0.1.0

opposite relations or cycled enumerations
true/false, True/False, TRUE/FALSE, left/right
also
** truE > false, tRUe > false, FaLsE > true, LeFT > right`**

Pressing the key **`super+alt+up/down`** changes the value under the cursor ("true" or "false") to the opposite

**Version 0.1.0** adds the ability **to cycle more than two values**:

** “Jan” > “Feb” > “Mar” > … > “Dec” > “Jan”**

Example of settings see in [https://github.com/rmaksim/Sublime-Text-2-Inc-Dec-Value/blob/master/inc_dec_value.sublime-settings](https://github.com/rmaksim/Sublime-Text-2-Inc-Dec-Value/blob/master/inc_dec_value.sublime-settings)

also in v0.1.0 settings added to the menu

Preferences -> Package Settings -> Inc-Dec-Value (Settings and Key Bindings)

0 Likes

#21

A really great plugin, thanks for sharing.

There is only one issue:
There is no “super” key in Windows, so the included keymaps doesn’t work (or I don’t know how to trigger it).

FWYK, the only free keymaps with the up/down arrows is shift+alt+(up/down)

0 Likes

#22

Thanks! )

in Linux super = win, may be and in Windows?

0 Likes

#23

[quote=“rmaksim”]

in Linux super = win, may be and in Windows?[/quote]

You’re right! Never realized that.
Unfortunately win+(up/down) is already used by Windows 7, so it doesn’t work for ST2.

May I ask you to replace the super+(up/down) keymaps by ctrl+super+(up/down) (or something else) in Windows keymaps file?
Thanks.

0 Likes

#24

[quote]Unfortunately win+(up/down) is already used by Windows 7, so it doesn’t work for ST2.

May I ask you to replace the super+(up/down) keymaps by ctrl+super+(up/down) (or something else) in Windows keymaps file?
Thanks.[/quote]

in windows used by default with ctrl+alt

{ "keys": "ctrl+alt+up"], "command": "select_lines", "args": {"forward": false} }, { "keys": "ctrl+alt+down"], "command": "select_lines", "args": {"forward": true} },
also in windows and linux

{ "keys": "ctrl+up"], "command": "scroll_lines", "args": {"amount": 1.0 } }, { "keys": "ctrl+down"], "command": "scroll_lines", "args": {"amount": -1.0 } },

I did so, that would be adjacent keys, and did not have to memorize other combinations
alt, win, alt+win

May be other suggestions?
for example: alt+left/right, super+left/right, super+alt+left/right - if you’re not using them
or alt+pageup/pagedown, super+pageup/pagedown, super+alt+pageup/pagedown

0 Likes