last day (15 days later) » 

7:05 PM
1
A: Increment values/numbers in Sublime 3

ndnYou are correct. Text pastry is perfect for your case. To install it (assuming you have package manager installed) simply Ctrl+Shift+p -> ip -> enter -> textpastry -> enter Now just select the numbers you want to change (search with regex enabled): (?<=<VValue type="int" value=")\d+(?=" />) ...

 
Awesome, gonna check this out. A little confused for installing it... I guess I download the zip, extract and then which file do I select or where to install it to so Sublime picks it up? Cheers, very much appreciated! :)
Ok, got it installed. I just have one issue... The Ctrl+Shift+n extends the selection past the />. For example it's extending it to just before the " of the next line... after false <VValue type="int" value="1" /> <BFD2GrooveSlot fill="false">
Do I need to do find and replace or just find and find all with that regex command? Thanks for the help, family new to these types of commands in Sublime, but they're awesome and a huge time saver.
 
ndn
@AshleySmith, my bad, it should be Alt, not Shift, updated.
@AshleySmith, findall (aka select all with multiple cursors).
 
Sorry, not sure if increment is the right wording as it should be value plus 60. Do need to install SelectionRubyEval for this of can I do the Ctrl+Alt+n? Cheers for the help!
 
ndn
@AshleySmith, unfortunately, I do not know of a TextPastry command that lets you increment. But evaluators are great in text editors, they give you unlimited power. If you know ruby, SelectionRubyEval is a must. If not, there are other eval packages as well.
hi there
 
Hi ndn, thanks for the help,much appreciated. Sorry, kinda confused here with the steps. Can I use the Auto Step to change those values by 60... so as value="0" 0 x60
Not sure if that makes much sense as i don't know commands...
 
ndn
7:08 PM
sorry, I saw that part later and decided not to delete the original post
as far as I know, there is no way to increment numbers using textpastry. Textpastry is a generator, it doesn't have programming languages capabilities
that is why I proposed SelectionRubyEval
do you happen to have ruby installed?
or maybe we can search for another evaluator package
 
Cool! I couldn't get Ctrl+Enter to select, only shows find results. I don't have Ruby installed, only have Sublime.
It looks as those you can do this with Text Pastry with that Auto Step command...?
 
ndn
oh, it's Altr+enter
sorry again, I do it mechanically
ok, one sec
ok, found one
 
cool
 
ndn
install the Evaluate plugin
again ctrl+shift+p | -> ip | -> Evaluate ->enter
 
done
 
ndn
7:16 PM
ok, now using that regex, get a cursor selection for the numbers with alt+enter
 
shift+cmd+p for command palette here... on mac
 
ndn
right, cmd :)
I'm using linux
 
is that find/replace?
not sure how to get cursor selection... alt+enter just adds new line
 
ndn
well, you should findall with the regex from the answer (I will update it btw when we are done)
 
cool, appreciated!
 
ndn
7:18 PM
ok, seems that shortcuts are different
just search for the regex and click the Find All
 
ok, find all
done
 
ndn
now tap the right arrow once to go after the selection and type +1
 
ndn
now go twice to the right (with the arrow) after the +1 and cmd+shift+left arrow trice (to select the original_number+1)
 
cursor already after +1 so do I just cmd+shift left twice to select?
 
ndn
7:21 PM
well, yes, my mistake
the idea is just to select the "_original_number_+1"
 
ok, think it's citric+shift, i selected all the line... 2 secs
ok, ctrl+shift
selected...
 
ndn
after that, the shortcut should be cmd+shift+e
 
ah, that does it by 10, so I should do +6?
 
ndn
not sure, if it's not just type evaluate in the command palette
what do you mean?
what happened xd
 
it basically increase numbers by 10... so 11, 21, 31, etc...
increased
it needs to be 61, 62, etc...
 
ndn
7:25 PM
oh, right
 
0 = 60, 1 = 61, 2 = 62
 
ndn
forgot about that
 
ndn
sorry, just undo and use +60 instead of +1 :)
 
ok, testing
 
ndn
7:26 PM
it might sound cumbersome, but if you do such things all day it takes 3 sec. Sublime text is really awesome :)
 
that just adds 60 to the end
now 160, 260
I guess I need x60?
 
ndn
o.0
it adds them for me
could you try the command instead of the shortcut
it might be different
 
x60 didn't work
ok, what's the command?
 
ndn
evaluate (type it in the command palette)
 
ok, cursor to the right
 
ndn
7:29 PM
it just moved the cursor to the right?
what was selected before you ran the command?
 
I have 30 selections, the cursor is to the right of those
 
ndn
the 30 selections are _number_+60
?
 
just number at the mo
no +60
 
ndn
ah
you need to select the number too
 
i tried +60 and cmd+shift+e and that just added the number 60 to the end
 
ndn
7:31 PM
because +60 = 60 :)
 
oh, so 0+60 selected?
 
ndn
right
 
lemme try
 
ndn
and 1+60; 2+60 and so on
 
AWESOME!!!!!
 
ndn
7:32 PM
:))
ok, I'll update the answer
 
Ok dude, owe you a pint!!! :)
 
ndn
happy to help :)
 
Will save this discussion too!
Thank you, much! :)
 
ndn
updated the answer
 
Thanks, saved my bacon!!! :)
 
ndn
7:40 PM
have a nice day
 
You too!
 

last day (15 days later) »