Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Order folders on top #2935

Closed
drewhamlett opened this issue Feb 22, 2013 · 38 comments
Closed

Order folders on top #2935

drewhamlett opened this issue Feb 22, 2013 · 38 comments

Comments

@drewhamlett
Copy link
Contributor

Instead of alphabetical order have option or default to folders on top. This is how most text editors and ides do it.

See Chocolat text editor option.

If enabled, the folders will be shown above files in the source list.
@WebsiteDeveloper
Copy link
Contributor

as far as i know folders are on top at least on windows

@drewhamlett
Copy link
Contributor Author

Screen Shot 2013-02-22 at 9 52 23 AM

Not for me

@WebsiteDeveloper
Copy link
Contributor

are you on a mac?
because in the tree sort function there is some windows specific code

@drewhamlett
Copy link
Contributor Author

Yea I'm on Mac. Mean't to mention that.

@njx
Copy link

njx commented Feb 22, 2013

We're following the platform convention--on Mac folders are mixed in with files, on Windows they're sorted to the top. We could add a sorting preference though. Marking move to backlog.

@peterflynn
Copy link
Member

Fwiw, on the Mac Espresso, TextMate and Coda all show files and folders intermingled too -- seems pretty standard. OTOH this seems very easy to have a pref for.

As a workaround, you can hack your local copy of Brackets just by removing the brackets.platform === "win" check in ProjectManager._renderTree().

@drewhamlett
Copy link
Contributor Author

TextMate 2 orders folders first out of box. I haven't used the first Textmate in so long I can't remember what it does.

Screen Shot 2013-02-22 at 5 06 36 PM

Chocolat

Screen Shot 2013-02-22 at 5 07 05 PM

Then most of the IDE's I've used. Netbeans, Eclipse, Webstorm.

Thanks for your help though. I've never understood why MacOSX does this. Makes no sense to me.

@WebsiteDeveloper
Copy link
Contributor

i wanted to implement a sorting preference but i wanted to ask if sombody has a good idea how to integrate such a feature nicely into the UI

@njx
Copy link

njx commented Feb 25, 2013

@WebsiteDeveloper - In the current UI it would make some sense to add it to the Recent Projects dropdown, but that would be a little weird. We're currently planning to revamp the organization of this UI (that's the "Topcoat parity" work on the backlog that @GarthDB is researching), so it's probably best to wait until that happens before deciding where to put this functionality. Thanks.

@GarthDB
Copy link
Member

GarthDB commented Feb 25, 2013

That would be a nice feature.

@WebsiteDeveloper
Copy link
Contributor

@GarthDB let me know once you know have decided where to add it to the UI, even if the UI isn't implemented yet, because then i would start working on the internal things an later add the UI.

@adrocknaphobia
Copy link
Contributor

Moved to backlog: https://trello.com/c/l3ce9hgK

We just need a little UX support before we can add this feature. I'm closing the issue, but keeping the pull request open.

@ghost
Copy link

ghost commented Apr 29, 2014

This is my least favorite part of Brackets ... feels so janky with folders randomly (alphabetically) scattered throughout. :)

@RaymondLim
Copy link
Contributor

@ensocloud You should be able to get folders on top of files by adding "sortDirectoriesFirst": true to brackets.json. From Help menu select Open Preferences File and then copy and paste the preference that I mentioned above. Make sure you add a comma to the end of the above line before you paste it in as the last preference.

@hmaesta
Copy link

hmaesta commented May 7, 2014

Thank you, @RaymondLim! 👍
I hope this option can be part of UI some day. :-)

Now I am just waiting 'two-row layout' [#7669] to Brackets become perfect. Haha.

@AgtLucas
Copy link

@RaymondLim 👍 Thanks!

@1-800-jono
Copy link

Awesome - this works great. Thanks @RaymondLim

@peterflynn
Copy link
Member

Adding 'fixed' tag since this was implemented back in PR #7138

@angiehjort
Copy link

@RaymondLim ohmygod, thanks! suddenly so much pain is taken away

@lmartins
Copy link

Thank you for the fix.

@BoeFly
Copy link

BoeFly commented Apr 1, 2015

@RaymondLim You da man!

@imechemi
Copy link

imechemi commented Sep 8, 2015

@RaymondLim 👍 this was painful for those who are switching from other editors like sublime.

@philchanet
Copy link

Thanks a lot @RaymondLim - I love Brackets even more, now.

@Tusko
Copy link

Tusko commented Jan 11, 2016

@RaymondLim Thank you so much!

@HenrichJones
Copy link

@RaymondLim Thank you so much, awesome!!!

@antonio-gomez
Copy link

Great to have this feature, just add in your brackets.json preferences the following:
"sortDirectoriesFirst": true

@mintjava
Copy link

@antonio-gomez is there any thing i should enable or do something after doing this. Why am i not able to get it though i change it correctly.

@redmunds
Copy link
Contributor

@mintjava It sounds like you have a syntax error in your preferences json file. Try installing the JSONLint extension -- it will tell you if there are any errors in that file.

@stevemillerbrewd
Copy link

@RaymondLim! Cheers buddy :)

@ghost
Copy link

ghost commented Jan 28, 2017

Excellent, Thank you for that recommendation @RaymondLim.

I had a comma at the end of the (sortDirectoriesFirst) instruction, which it didn't like.

Once I removed that comma, Brackets sorted the folders and files as expected! :)

@mariola-kasznicka
Copy link

mariola-kasznicka commented Feb 14, 2017

It's not working on my Mac. I set "sortDirectoriesFirst" on true, but I don't see any changes :(

@redmunds
Copy link
Contributor

@MarioL See this comment above. Also, try re-starting Brackets.

@TK42DAN
Copy link

TK42DAN commented Aug 6, 2017

Super late, but since this was so helpful to this OCD newb, I thought I'd add something.

I think one thing that may confuse someone is that in the wonderful post by RaymondLim, when he refers to adding "a comma to the end of the above line," the "above line" he is referring to is the line in your brackets.json file beneath which you will be adding the code he is providing. He is NOT referring to the line of code ("sortDirectoriesFirst": true) that is "above" in his comment. So, you DO NOT want to add a comma to "sortDirectoriesFirst": true" -- at least not until you decide to add more code after that line.

FWIW, my default brackets.json file only contained some font information. I added the line of code above and it's working on my Mac. Here is the exact text in that file for me if anyone wants to copy/paste:

{
"fonts.fontSize": "17px",
"fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
"sortDirectoriesFirst": true
}

@DHBuild002
Copy link

DHBuild002 commented Aug 6, 2017

Your file should look like this when complete:

brackets - updated pref file location

  • I have also included the revised location of the preferences file in the latest version of Brackets.

Best of luck.

@kashifkiduniya
Copy link

Simply use this extension for mac

@DHBuild002
Copy link

A big thank you to you, @kashifkiduniya !

@kashifkiduniya
Copy link

@DHBuild002 You always welcome!

@jpasholk
Copy link

jpasholk commented Dec 1, 2018

Super late, but since this was so helpful to this OCD newb, I thought I'd add something.

I think one thing that may confuse someone is that in the wonderful post by RaymondLim, when he refers to adding "a comma to the end of the above line," the "above line" he is referring to is the line in your brackets.json file beneath which you will be adding the code he is providing. He is NOT referring to the line of code ("sortDirectoriesFirst": true) that is "above" in his comment. So, you DO NOT want to add a comma to "sortDirectoriesFirst": true" -- at least not until you decide to add more code after that line.

FWIW, my default brackets.json file only contained some font information. I added the line of code above and it's working on my Mac. Here is the exact text in that file for me if anyone wants to copy/paste:

{
"fonts.fontSize": "17px",
"fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
"sortDirectoriesFirst": true
}

This is what helped me understand it. Thanks man!

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

No branches or pull requests