Sublime Forum

How to get files sorted in numerical order


When ever I work with image files I like to have the numerical order sorted from top to bottom or bottom to top 1 2 3 4 5 6 6 7 8 9 10 (for example).
I noticed that the numbers get mixed. Is there a way in the settings to get the order the way I want.
Regards & Thanks,



As far as I’m aware except for being able to change the order to multiple top level folders that you’ve individually added to your project or opened in the window, there’s no way to change the order of the files that display.

In your case the files aren’t sorted the way you expect because the entire filename is treated as a string without regards to the number at the end being “special”, so all of the items whose number portions start with a 1 come first, then those with 2 and so on; 1 comes before 10 because 10 is longer.

If you have control over the files and you really want them to display in the order you want, you can rename the files to always have the same number of digits in the number (i.e. use galabau-01.jpg instead of galabau-1.jpg). That’s semi-invasive though, since you then also have to fix all of the places where the files are referenced, etc.



Thanks OdatNurd much appreciated!!!