Sublime Forum

Sorting woes

#1

Hey there-

I’m new to Sublime, coming from TextPad (which I had used for AGES), and I’m still trying to find my way around a couple minor hitches. I see this has been discussed more than a few times on the forum already, but for all of its advantages, Sublime seems to be severely lacking in the sorting department.

TextPad had wonderfully advanced sorting options, as evidenced here:

sort

So if I had a list like this, for example:

4x navy beans
2x alfalfa sprouts
3x black beans
1x kidney beans
8x black-eyed peas
3x broad beans
6x green beans
1x bean sprouts
2x lentils
1x peas

I could just change the First Key to be 2, so that the items could be sorted by their name, as opposed to their quantity, like so:

2x alfalfa sprouts
1x bean sprouts
3x black beans
8x black-eyed peas
3x broad beans
6x green beans
1x kidney beans
2x lentils
4x navy beans
1x peas

I don’t suppose anyone has managed to find/write a script that does something similar in Sublime? I actually use this function quite often in my job; except I’d replace the list of legumes with names of bands & records, of course… :wink: Thanks!

Chris

0 Likes

#2

I don’t think it is undoable, but certainly not trivial (meaning a one off plugin script). ST doesn’t provide API’s to construct a GUI like the picture with text inputs, radio buttons etc. So you’ll have to make do with whatever the current API provides. So tldr; a person who knows both this functionality of TextPad & familiar with Python & ST’s Python API could do it. But it might be a full blown package on it’s own if the goal is to replicate that entire thing.

Also another related question could be, If TextPad can do this well for you, why switch to ST ?

1 Like