If you have single-child Folders, VS Code will automatically compact them.
Which is not always what we want.
In this post, you’re going to find out how to change the display of single-child folders in the Explorer view:
Compact Folders setting
The display of the single-child folders can be changed via the Explorer: Compact Folders setting.
You can change it in two ways:
- Settings UI
settings.json
file
To change the value from the Settings UI, press down CTRL + , (comma) or go to File -> Preferences -> Settings and search for compact folders
.
Toggle off the option and you’re all set
To change the value from the settings.json
file, add the following:
"explorer.compactFolders": false
false
toggles off the setting, meaning the folders will be compacted.Happy coding
Let me know what you think about this article through comments below, or on Twitter at @pelu_carol.
If you find this article helpful, please share it with others and subscribe to the blog to support me, and receive a bi-monthly-ish e-mail notification on my latest articles.