How can I sort my project folders by names?

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.

That’s bad. :frowning:

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 script:

arrayEqual = (a, b) ->
  a.length is b.length and a.every (elem, i) -> elem is b[i]

sortPaths = (projectPaths) ->
    paths = atom.project.getPaths()
    if not arrayEqual(paths, projectPaths)


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.

1 Like

For now there is a package that does sorting by alphabetical order -

There will be first class support for DnD once this PR is merged -

The PR (#525) has been merged, and using drag and drop to sort projects now works since version 1.13.0 - :grinning: :tada: