A JetBrains IDE plugin that nests directories under files with matching names in the project tree.
Organizes your project tree with Rails/Laravel-style concern patterns by nesting directories under their corresponding files:
Before: After:
├── User.php ├── User.php
├── User/ │ └── User/
│ ├── HasRoles.php │ ├── HasRoles.php
│ ├── HasPermissions.php │ └── HasPermissions.php
│ └── Auditable.php └── Order.php
├── Order.php └── Order/
└── Order/ ├── Billable.php
├── Billable.php └── Shippable.php
└── Shippable.php
The User/ and Order/ directories collapse under their matching files for a cleaner, more organized tree.
- Open your IDE (PhpStorm, RubyMine, WebStorm, etc.)
- Go to Settings → Plugins → Marketplace
- Search for "File & Directory Nesting"
- Click Install
- Download the latest release
- Go to Settings → Plugins → ⚙️ → Install Plugin from Disk
- Select the downloaded ZIP file
No configuration needed! The plugin automatically works for these file types:
- PHP - Laravel traits, concerns
- Ruby - Rails concerns
- Vue - Component folders
- JavaScript - React/Node component folders
- TypeScript - TypeScript component folders
- JSX/TSX - React components
- Python - Module folders
- Go - Package folders
Customize which file extensions trigger nesting:
Settings → Editor → General → File & Directory Nesting
- Add or remove file extensions
- Enable/disable the plugin globally
- Case-insensitive matching
Works with all JetBrains IDEs:
- PhpStorm
- RubyMine
- WebStorm
- IntelliJ IDEA
- PyCharm
- GoLand
- And more
Requires 2023.3+ or later.
The plugin uses IntelliJ's TreeStructureProvider API to modify the project tree structure:
- Detects files with enabled extensions (e.g.,
User.php) - Looks for matching directories (e.g.,
User/) - Nests the directory under the file in the tree view
- No files are moved - it's purely visual organization
Important: This is different from IntelliJ's built-in File Nesting, which handles file-to-file relationships (e.g., Component.tsx → Component.css). This plugin handles file-to-directory relationships.
Models/
├── User.php
│ └── User/
│ ├── HasRoles.php
│ ├── HasPermissions.php
│ └── Auditable.php
models/
├── user.rb
│ └── user/
│ ├── authenticatable.rb
│ ├── confirmable.rb
│ └── trackable.rb
components/
├── Button.tsx
│ └── Button/
│ ├── Button.stories.tsx
│ ├── Button.test.tsx
│ └── types.ts
Built with:
- Kotlin 2.1.0
- IntelliJ Platform Plugin SDK 2.2.1
- Gradle 8.5
./gradlew buildPluginThe plugin will be in build/distributions/.
./gradlew testContributions welcome! Please feel free to submit issues or pull requests.
Apache 2.0 - See LICENSE for details.
- JetBrains Marketplace (pending approval)
- GitHub Releases
- Issues
made with ☕ and 🤖 on a lazy Sunday afternoon