How do I stop VS Code from combining my folders in the directory tree?

oreohive labs research log

How do I stop VS Code from combining my folders in the directory tree?

2025-03-11T11:12:00+0000
logged by:

oreo

How can I stop VS Code from doing... that?

Compact Folders

I have to turn this sh*t off on every single new install of VS Code or VSCodium I use.

'Compact Folders' is a feature of VS Code's left-hand Explorer that 'renders folders in a compact form'. Who'd've guessed?

It's a feature that, more specifically, will render one folder and an alone child folder as one, single folder.

If a directory contains nothing but another directory, the two will be rendered as one folder in the Explorer. The application quotes 'Java package structures' as a potentially helpful use case for this functionality.

That's fair, but I kind of hate it. I find it confusing, and, in the kinds of projects I work of, generally unintuitive. While I understand the benefits of the space saving, I'd still much rather have my directory trees displayed in a perfectly consistent manner.

Regardless of whether I feel this is a sane default, it's good we have the option, eh?

How to turn this off

If you're already here, though, you probably just wanna knock it off. So, let's cut to the chase.

  • Head to Settings.
  • - In your VS Code or VSCodium application, head to File in the menu bar.
  • - In this File drop down, head to Preferences.
  • - From there, open Settings.
  • In the Search settings search bar at the top, search for 'Compact'. You should find a setting that looks like this:

  • Uncheck it.
  • Here, you may also find these related options, which you can play with to your heart's content:

Cool. That's it. You've done it. You can go away and build cool things now.

Or you can donate me a coffee if you found this helpful: https://ko-fi.com/oreohive