Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar Sort Options #328

Open
anatomatic opened this issue Jun 7, 2014 · 59 comments
Open

Sidebar Sort Options #328

anatomatic opened this issue Jun 7, 2014 · 59 comments

Comments

@anatomatic
Copy link

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.

@juanmiguel431
Copy link

I would like the way to sort files like windows.

image

@keith-hall
Copy link
Collaborator

@juanmiguel431 for reference, this is called natural sort order - https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/

@Klortho
Copy link

Klortho commented Oct 18, 2016

Another option that would be nice (see also #721 ):

  • [Directory/file sorting]: dirs on top, then files (current); files on top, then dirs; interleaved (no sorting based on file/dir nature)

@stevenvachon
Copy link

Do it.

@benwolman
Copy link

I'd love to see sorting by file type.

@awmottaz
Copy link

I would also like the alphabetical sorting to be case-insensitive. It appears that it orders alphabetically by ASCII code.

@KiboOst
Copy link

KiboOst commented Apr 5, 2017

Yes, sorting file by type would amazing!

@GospelNerd
Copy link

+1 for sorting by filetype

@randy3k
Copy link

randy3k commented Jul 18, 2017

on Mac, the default sorting is case insensitive. I would be nice to have an option to sort files case sensitively.

@roamn
Copy link

roamn commented Aug 4, 2017

Years passed ...

screenshot_3

@vishalp36
Copy link

Yes, sorting file by type would amazing!

@titoBouzout
Copy link
Collaborator

titoBouzout commented Sep 14, 2017

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])

@tobirothschild-gugg
Copy link

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.

@jdhao
Copy link

jdhao commented Dec 13, 2017

@tobirothschild-gugg , +1 for sorting the files according to last modified date.

@sublimehq sublimehq deleted a comment from manuelphdev Jan 18, 2018
@eliemassaad

This comment has been minimized.

@zzh8829

This comment has been minimized.

@zhouyisu

This comment has been minimized.

@wavemode

This comment has been minimized.

@achamess

This comment has been minimized.

@kanlukasz

This comment has been minimized.

@ron-wolf
Copy link

ron-wolf commented Apr 2, 2019

@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.

@titoBouzout
Copy link
Collaborator

We dont know. The features that are being worked appear in the change log for the dev builds. https://www.sublimetext.com/3dev

@sublimehq sublimehq locked as too heated and limited conversation to collaborators Nov 20, 2019
@titoBouzout
Copy link
Collaborator

I locked this issue because the conversation is useless, is obvious what to do. Just go ahead and +1 what you like.

@wbond
Copy link
Member

wbond commented Nov 20, 2019

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.

@titoBouzout
Copy link
Collaborator

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.

@sublimehq sublimehq unlocked this conversation Nov 20, 2019
@sublimehq sublimehq locked and limited conversation to collaborators Nov 20, 2019
@wbond
Copy link
Member

wbond commented Nov 20, 2019

@titoBouzout Please stop locking the issue, you are being actively hostile to the community

@sublimehq sublimehq unlocked this conversation Nov 20, 2019
@titoBouzout titoBouzout pinned this issue Nov 20, 2019
@sublimehq sublimehq locked and limited conversation to collaborators Nov 20, 2019
@titoBouzout titoBouzout unpinned this issue Nov 20, 2019
@sublimehq sublimehq unlocked this conversation Nov 21, 2019
@evandrocoan
Copy link

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)

@patakk
Copy link

patakk commented Nov 21, 2019

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?

@rwols
Copy link

rwols commented Nov 21, 2019

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.

@John-Dean
Copy link

Is there a chance for this to get added in ST4?

@vizvamitra
Copy link

vizvamitra commented Dec 9, 2021

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

@jtesch
Copy link

jtesch commented May 3, 2022

Bro it's been 8 years just add it already lmao

@Gerst20051
Copy link

Gerst20051 commented May 4, 2022

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:

  • Asc
  • Asc (Natural)
  • Desc
  • Desc (Natural)

The secondary ones would be:

  • Created Date
  • Last Modified Date
  • Case Sensitive
  • Case Insensitive

References:

https://www.softwaretestinghelp.com/unix-sort-command/

@vizvamitra
Copy link

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

@hyrious
Copy link

hyrious commented May 12, 2022

I'm upvoting this feature too, especially sort 10.txt after 2.txt.

FYI, here's the implementation in vscode:

https://github.com/Microsoft/vscode/blob/main/src/vs/base/common/comparers.ts

@sukinoverse
Copy link

sukinoverse commented Nov 8, 2022

Upvoting this issue, When working with large number of files with versioning at this end like xx-1.0.123.yml and xx-1.0.2 it's put 1.0.2 below the 1.0.123. It's very annoying 😂 and it forces me to use other editors when dealing with this kind of projects.

@fabsh
Copy link

fabsh commented Nov 23, 2022

Sorting files according to what we humans expect is rather non-trivial: https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/

That might be the case. But it's also rather obvious that the way in which Sublime orders files in the sidebar right now is something that nobody would expect. I mean, what human sorts numbers like this?

sublime-sort

I understand that there are valid technical reasons for this, but from the perspective of a user, who cares? Either sort it in a more sane way or give people the option to do so. It's not like Sublime is generally stingy with config options. Or that they clutter up an UI somewhere. They're lines in a text file.

@fakefarm
Copy link

:bump:

@melvinroest
Copy link

melvinroest commented Aug 27, 2023

Looking for more flexibility on this as well. I want folders to appear next in front of file names that have the same name. I don't want a folder/file split.

To reorganize a tree view is quite a feature when it comes to big projects with many files/folders.

Related to this is: #721

@va9iff
Copy link

va9iff commented Apr 19, 2024

I'm using Sublime Text as my notepad. Would like to have a "sort by date" feature. Currently, I'm using an insne yy-mm-dd--mm-ss <note name>.md syntax (set up a subl $(date '+/home/va9iff/notes/%y-%m-%d--%H-%M.md') on a shortcut) just to sort the files in the sidebar. Yeah they're all in one folder, It's like my "inbox"

@jtheletter
Copy link

This feature request is now ten years old, and it still is in high demand. Please let us sort the sidebar.

@deadhitter1
Copy link

I'm going to switch to another program.
Ten years of neglect isn't something you can just wave away with an article, nor something that goes away with a polite request.

@mkanet
Copy link

mkanet commented Aug 18, 2024

@deadhitter1 I also got tired of waiting. I switched to VSCode. It's amazing something this simple was never implemented in SublimeText

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests