gitmyhub

vscode-file-nesting-config

JavaScript ★ 3.6k updated 2mo ago

Config of File Nesting for VS Code

This repository provides a configuration snippet for Visual Studio Code that uses the editor's file nesting feature to keep the file explorer tidy. File nesting lets VS Code hide secondary files under a primary one in the sidebar, so that config files and generated files do not clutter the view of your project's main source files. For example, a Dockerfile can be set as the parent entry, with docker-compose files, .dockerignore, and other Docker-related files nested beneath it.

The snippet is a JSON block you paste into your VS Code settings file. It defines which files should nest under which parent files, organized by project type and file pattern. There are entries for popular frameworks and tools including Next.js, Nuxt, Astro, Cargo (Rust), Go modules, Gradle, Composer (PHP), and many others. It also handles common cross-project files like .gitignore, .env variants, and Dockerfile families. The patterns are maintained by the repository author and updated periodically as new tools emerge.

There are two ways to use it. You can copy the JSON block directly into your settings.json file and update it manually when new entries are added. Alternatively, there is a VS Code extension linked in the repository that handles updates automatically, so your nesting rules stay current without manual copying.

The repository requires VS Code version 1.67 or newer, which is when the file nesting feature was introduced. The nesting rules are the author's own preferences and are described as opinionated.