Copyright Fold

VS Code extension that auto-collapses copyright and license headers in source files.
Copyright headers are mandated by many organisations, but they add noise for frequent contributors. This extension satisfies both sides: compliance/legal gets the headers in the file, engineers get a clean view.
Features
- Automatically folds copyright/license headers when files are opened
- Detects headers across 30+ programming languages
- Uses VS Code's native folding — click the fold chevron to expand
- Configurable keywords, scan depth, and language exclusions
Installation
Install from the VS Code Marketplace, or search for "Copyright Fold" in the Extensions panel.
How It Works
- When a file opens, the extension scans the first lines for a comment block
- If the comment contains copyright-related keywords, it registers a fold range
- The fold is applied automatically, collapsing the header to a single line
- Click the fold chevron (or use
Ctrl+Shift+]) to expand
Configuration
| Setting |
Type |
Default |
Description |
copyrightFold.enabled |
boolean |
true |
Enable or disable copyright header folding |
copyrightFold.autoFold |
boolean |
true |
Automatically fold headers when files are opened |
copyrightFold.keywords |
string[] |
see below |
Keywords used to identify copyright headers |
copyrightFold.maxLines |
number |
50 |
Maximum lines to scan from the top of each file |
copyrightFold.excludedLanguages |
string[] |
[] |
Language IDs to exclude from folding |
Default keywords: copyright, (c), ©, license, spdx, all rights reserved, licensed under, permission is hereby granted, redistribution
Commands
| Command |
Description |
Copyright Fold: Toggle Auto-Fold |
Toggle automatic folding on/off |
Copyright Fold: Fold All |
Fold copyright headers in the active file |
Copyright Fold: Unfold All |
Unfold copyright headers in the active file |
Supported Languages
Detects comment styles for: C, C++, C#, Java, JavaScript, TypeScript, Go, Rust, Swift, Kotlin, Scala, Dart, Python, Ruby, Perl, Shell, HTML, XML, Vue, Svelte, Astro, SQL, Haskell, Lua, Lisp, Clojure, MATLAB, PowerShell, Batch, PHP, Erlang, Elixir, and more.
Unknown languages use a broad fallback that covers all common comment styles.
Acknowledgements
Inspired by vscode-inline-fold by Mohammed Al Amri, which is unfortunately no longer maintained. That project pioneered the approach of using VS Code decorations to visually hide inline content — this extension adapts the concept for multi-line copyright headers using VS Code's native folding API.
License
MIT