I have a lot of project folder in my Atom editor. How can I sort it by names, not by adding date?
You mean like this?
I’m not sure if this works for multiple root folders. Try it?
No. I mean project folders like “tree-view” in your picture.
Please go to the settings page shown in the screenshot, then select “Sort Folders Inline” and see if that does what you want.
You currently can’t sort project folders, unfortunately. The
Sort Folders Before Files option (renamed from
Sort Folders Inline - that’s a really old screenshot) only applies to subfolders / files of project folders.
Do you know about a issue/feature request about it? It would be great to just drag and drop to sort (with ctrl to copy…).
I was able to fix this problem by putting the following in my init.coffee script:
arrayEqual = (a, b) -> a.length is b.length and a.every (elem, i) -> elem is b[i] sortPaths = (projectPaths) -> paths = atom.project.getPaths() paths.sort() if not arrayEqual(paths, projectPaths) atom.project.setPaths(paths) sortPaths() atom.project.onDidChangePaths(sortPaths)
It would be awesome to turn this into an API for sorting the project paths (both project paths and file/folder paths) so people could implement this however they want.
Thanks a lot for sharing this, drelyn86! It’s way better than the default (sorting by date added).
At some point atom should really allow to rearrange project folders in tree-view via drag and drop, though.
If this is possible then it’s also possible to sort them manually (drag and drop, alphabetically, date, etc…). This should be a default option in the tree view. Thanks @drelyn86 for this solution. Works perfectly.
For now there is a package that does sorting by alphabetical order - https://atom.io/packages/atom-sort-projects
There will be first class support for DnD once this PR is merged - https://github.com/atom/tree-view/pull/525