Open anatomatic opened 10 years ago
I would like the way to sort files like windows.
@juanmiguel431 for reference, this is called natural sort order - https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/
Another option that would be nice (see also #721 ):
Do it.
I'd love to see sorting by file type.
I would also like the alphabetical sorting to be case-insensitive. It appears that it orders alphabetically by ASCII code.
Yes, sorting file by type would amazing!
+1 for sorting by filetype
on Mac, the default sorting is case insensitive. I would be nice to have an option to sort files case sensitively.
Yes, sorting file by type would amazing!
I believe the best approach to fix this is to make the sorting function public so anyone sort the files as they wish by just defining a function. It would be nice to have a menu above the sidebar or on bottom listing as menuitems all the available sorting functions defined (by date, by type, by name, etc [as defined by the custom function(s) description])
I would love to be able to sort by last modified date. When dealing with tons of files this is the easiest way to find what you are working on.
@tobirothschild-gugg , +1 for sorting the files according to last modified date.
+1 for sorting functionality
+1 for customized sorting
+1 would definitely love to have the sorting functionality
+1 I would pay money for this feature (kidding, sort of)
+1. This seems like a common and reasonable request.
still nothing?
@FichteFoll @titoBouzout @keith-hall Could you guys provide some information on whether or not this feature is in the works? I’m unsure exactly who to ask about this.
We dont know. The features that are being worked appear in the change log for the dev builds. https://www.sublimetext.com/3dev
I've waited several years for a real sidebar and basic sidebar options going back to ST2. This issue may end up being what ultimately pushes me to switch to VSCode. VSCode doesn't look as nice or as fast as ST3.. but at least it's more functional.
A better sorting in the sidebar would be a nice feature to have. It's pretty odd to navigate trough versions without a natural order arrangement
It would be really nice to have an option to customise the ordering of the files + directories. I'd personally like to have any file named index.html
to be listed first in the folder for some projects.
Apparently this is such an irrelevant issue that it remains ignored even after all these years and years. The @titoBouzout's suggestion sounds great, but I guess we'll never see it realized..
VSCode it is..
I'd personally like to have any file named index.html to be listed first in the folder for some projects.
How would you foresee something like this working?
Apparently this is such an irrelevant issue that it remains ignored even after all these years and years.
It has been low priority because it would require some significant rewrites of how our internal data structure for files and folders stores and sorts data.
Additionally, in the grand scheme of things it doesn't seem like such a major issue compared to other things we could be working on. I guess for some people being able to change the sort order is enough to change their whole development environment.
I'd personally like to have any file named index.html to be listed first in the folder for some projects.
How would you foresee something like this working?
If it were possible to pass a lambda to the sorting function, then it would be pretty simple to do something like this.
Additionally, in the grand scheme of things it doesn't seem like such a major issue compared to other things we could be working on. I guess for some people being able to change the sort order is enough to change their whole development environment.
I love Sublime too much to switch to anything else. This would just be nice to have. But if it's too much effort maybe close this as a wontfix
or something?
If it were possible to pass a lambda to the sorting function, then it would be pretty simple to do something like this.
That would probably not be doable since the lambda would have to be written in Python and thus would need to round-trip the SHM process channel from the main editor to the plugin_host for every comparison in the sort. That involves serializing the data to be compared (allocating a string) sending it, deserializing, converting to Python, executing the Python function and then sending the result back.
It would be wicked slow. :-)
I love Sublime too much to switch to anything else. This would just be nice to have. But if it's too much effort maybe close this as a wontfix or something?
Well, I don't think it is a won't fix. I personally would prefer the sorting using natural case at the very least. It just is low priority compared to other things so far. If we closed every old issue, we'd miss out on lots of the fixes and improvements we had in 3, 3.1 and 3.2.
Additionally, in the grand scheme of things it doesn't seem like such a major issue compared to other things we could be working on. I guess for some people being able to change the sort order is enough to change their whole development environment.
Eh, I won't actually change it, it was a threat hoping it'll push things in the right direction :P
Anyway, I get it, but this is honestly the first time I've read a developer's response to this issue, which is an improvement I guess. But it seems rather weird that (seemingly) such a simple functionality would result in such an effort.
But it seems rather weird that (seemingly) such a simple functionality would result in such an effort.
Sorting files according to what we humans expect is rather non-trivial: https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/
There's no doubt that "sorting" is not trivial, in a human/culture/language/semantic scope, just let the regular sorting be.
AND and IF the user wants to define a "sorting" function, then just use that, if its slow then is not your business/problem any more, we want to sort. We dont care what ST developers think of our custom sorting functions.
You just default to your blazing fast sorting if no user defined sorting was found...... so you dont lose anything, you just give us something.....
In summary for the complete SublimeText software, give us the APIs, do not think of me, I dont care/never asked what you think. Just give us the APIs. The APIs give us freedom, I can think for myself and others do too. :) get wiser, you have a great editor, you add features, you should add(and fix man) the apis! -__-
Is not up to you to decide if its slow or not. People just asked here to group by file type, by file name, natural sorting, show index.html first. Well yeah I feel them, we all have different preferences, I name my stuff like "@TODO" so just the stupid sorting thing shows it on top or bottom. Just make the function public..... you wont be able never to make everyone happy. We talked enough here..... Theres too many comments. Its obvious what the resolution is.... is not as if yours or us sorting function needs to run a million of times per second, it only runs when you expand/new file/folder on how many times? fine, lets say 1000.... who has 1000 items in a directory? not to many..... how slow can be, and why do you even care?..... we wrote it after all....
I locked this issue because the conversation is useless, is obvious what to do. Just go ahead and +1 what you like.
is not as if yours or us sorting function needs to run a million of times per second, it only runs when you expand/new file/folder on how many times
No, it is invoked any time a file notification is received from the OS. We have to sort and find where the file is located in our in-memory tree. Beyond that, we actually do get bug reports from users having tens of thousands of files in directories complaining when things aren't fast.
fine, lets say 1000.... who has 1000 items in a directory? not to many..... how slow can be
Depending on how it is written in Python, really slow. I would not want the CPU taking 1s to decided where in the tree to store a file that was just created.
why do you even care?..... we wrote it after all....
Ultimately the users blame ST when there is poor performance, since it isn't easy to know that a customization is causing the issue.
I locked this issue because the conversation is useless, is obvious what to do.
I am answering questions from users. I don't think it is heated at all, just explaining the sort of decisions we have to consider in order to keep Sublime Text fast, and why sometimes trivial looking things aren't implemented right away.
Well you are wrong, you are deciding for the users, you can just add custom sorting while at the same time keeping stable (blazing fast ST TM sorting). But you dont want which is ok. Fine. Nothing else to talk I guess.
@titoBouzout Please stop locking the issue, you are being actively hostile to the community
Just go ahead and +1 what you like.
@titoBouzout, if the post is locked, no one can +1 (up vote comments) and any reference to this issue would not show up here, unless one of the developers referenced it or up voted it.
Although, if Python is not a performance viable API, then, a C++ API come to rescue: (Add a C++ API for critical/time sensitive code #3095)
But it seems rather weird that (seemingly) such a simple functionality would result in such an effort.
Sorting files according to what we humans expect is rather non-trivial: https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/
While you're correct, that is irrelevant and not the root cause of the problem. The reason this will take more than 5 years is not the complexity of the sorting algorithm(s), but rather the complexity of any file reordering (independent of the algorithm) since it would apparently require a lot of code rewrite and dealing with the file tree structure.
Which is pretty strange to me. Is it that difficult to separate the memory structure of the files from the front-end that displays it in the sideview?
While you're correct, that is irrelevant and not the root cause of the problem.
True. I also now see that Keith Hall has posted the same link about three years earlier.
Is there a chance for this to get added in ST4?
Here is a usecase for descending order:
Rails (a web framework written in Ruby) uses database migrations to incrementally migrate DB schema. All migrations are stored inthe same folder (db/migrate
). There is a naming convention for database migration files: the format is YYYYMMDDHHMMSS_migration_name.rb
(example: 20211209154612_create_users.rb
) which makes them sorted in a chronological order. Old projects may have a ton of migrations (ours has 513) but you are usually interested in only the most recent ones. So if you don't know the name / the date to Ctrl+P to the one you're interested in you need to scroll down through all those hundreds of files.
Would be great to be able to set sorting order either from a right-click menu of the folder or in a .sublime_project
file
Bro it's been 8 years just add it already lmao
I've also been thinking about this for a while. Perhaps it is worth creating a new standard that defines how to sort a directory.
I've compiled a few filename ideas:
.directory-sorting
.file-sorting
.folder-sorting
.ordering
.sorting
Any ideas on what the contents of this file would be and what all of the different sorting methods are?
The main ones would be:
The secondary ones would be:
References:
I also see another option, at least for my usecase: a "scroll to top/bottom of the expanded folder" buttons, shown only when the content of the expanded folder doesn't fit into screen. Yet this may be much harder to implement
Sorting files in the sidebar by date (ascending / descending) would be fantastic. Even more advanced, sort folders in the sidebar independently of each other.
I understand that there isn't a Sidebar API, so this would either need to be a core feature, or a plugin if a Sidebar API were to be released.