DEV Community

Cover image for Tidy Up Your VSCode Explorer with File Nesting
Rogério Rodrigues de Alcântara
Rogério Rodrigues de Alcântara

Posted on

4

Tidy Up Your VSCode Explorer with File Nesting

Just a quick note of a nifty VSCode feature to streamline the project's explorer view by nesting related files under a single parent file. This is done through the explorer.fileNesting.patterns setting.

explorer.fileNesting.patterns in action

It’s a visual aid that keeps your workspace uncluttered.

How to Configure File Nesting

To configure file nesting, access your settings JSON file and add or modify the explorer.fileNesting.patterns. Here's an example that nests common project files under package.json:



"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"package.json": ".babelrc, .browserslistrc, .dockerignore, .editorconfig, .env, .eslintignore, .eslintrc., .gitignore, .graphqlrc., .nvmrc, .prettierignore, .prettierrc.*, README.md, babel.config.json, cypress.json, jest.config.ts, jest.preset.js, nx.json, package.json, tsconfig.base.json, tsconfig.json, workspace.json, yarn.lock, vercel.json, netlify.toml, pnpm-lock.yaml"
}
Enter fullscreen mode Exit fullscreen mode




Benefits of File Nesting

  • Cleaner Workspace: Reduces clutter by showing only relevant files at a glance.
  • Improved Focus: Helps you focus on the files you are actively working on.
  • Better Organization: Groups logically related files together.

Remember, you can always adapt the nesting patterns to fit your project's structure and your personal preferences.

References

VSCode Docs - Explorer file nesting

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more