Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shrink down empty directories explorer in VSCode? [duplicate]

I'm looking for some way to reduce the visible size of directories in the explorer, that only have one directory/file in them. I'm not quite sure how to explain this, but basically I want to turn this:

OPEN FOLDER  
-ChildFolder  
--GrandchildFolder  
---GreatgrandchildFolder  
---file  
---file  

Into this:  
OPEN FOLDER  
-ChildFolder\GrandchildFolder  
--GreatgrandchildFolder  
--file  
--file  

GitHub does something like this, for example on https://github.com/Bukkit/Bukkit/tree/master/src (a java project), you see test/java/org/bukkit (hovering shows "this path skips through empty directories").

Is there any way to do this in VSCode? It's pretty minor but would be really nice to have when working across multiple java projects.

like image 287
Kade Avatar asked Jul 08 '17 03:07

Kade


People also ask

How do I reduce Explorer VS Code?

You cannot currently auto-hide the explorer. The GitHub issue tracking this is #3742. ctrl + b (Windows, Linux), cmd + b (OS X) is the keybinding to manually toggle the side bar.


1 Answers

This should be available mid-december 2019 with VSCode 1.41.

Compact folders in Explorer

In the File Explorer, we now render single child folders in a compact form.
In such a form, single child folders will be compressed in a combined tree element.
Useful for Java package structures, for example.

Setting explorer.compactFolders controls this behavior.
By default, this setting is turned on.

https://media.githubusercontent.com/media/microsoft/vscode-docs/vnext/release-notes/images/1_41/explorer-compact.gif

like image 183
VonC Avatar answered Sep 21 '22 13:09

VonC