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<strong>
.
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.
🎥 Need a video demonstration? Check this out:
Happy coding 😊
Let me know what you think about this article in the comments section below.
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.