Sublime Forum

Sidebar Group Folders with Single Sub-Folder

#1

I would like to have the folders with single sub-folders grouped together so I do not need to click through them to get to the main packages that I need to work with.

I am unable to find a plugin (SidebarEnhancements doesn’t seem to have this feature) or a topic this was discussed.

Is there anything that offers this functionality?

1 Like

Skip folder that only contains one sub folder?
#2

Sublime doesn’t do this on its own and there’s not currently any API that would allow a plugin to modify the contents/display of the sidebar, so I don’t think there’s any way to do something like that.

1 Like

#3

So, do you want to group or hide them? In case of the former, how do you imagine this “group” to work?

0 Likes

#4

Thanks for the quick replies!

I want to group them together, meaning that they would show up as:

tst.com.bla.bla.bla

followed by:

         mainPackage

I imagine this to work as in any major IDEs such as IntelliJ or Eclipse. However, sounds like this isn’t supported just yet, which is not a major problem.

Thanks!

0 Likes

#5

So my initial guess was right … I should have followed with it.

Anyway, what you meant aren’t exactly “empty” folders but folders with just one subfolder. Then ST could combine them and expand to the first directory that contains more, just like Github does here.
I like this idea, although I don’t particularly need it since I mostly develop in Python where namespaces are not as hierarchical.

Screenshot for convenience:

img

1 Like

#6

Yep, good point. Corrected the title and the main question.

0 Likes

#7

Here is the intended effect, if any good soul wants to try hacking on it:

0 Likes

#8

I guess this should be optional or exposed via the API, otherwise existing workflows like right clicking on a folder to open it in a file manager, search or create a new file etc would no longer be as possible on an ancestor

0 Likes

#9

Is there any updates to this?

0 Likes

#10

No; the sidebar still represents files as they appear structured on disk.

0 Likes

#11

It’s certainly a good idea. Toolchains that require/promote these redundant nested directories are mind-numbing!

Here is the most relevant feature request: https://github.com/sublimehq/sublime_text/issues/2993

0 Likes