https://github.com/bobmagicii/vscode-auto-fold
A Visual Studio Code extension to automatically fold code if a magic comment is found.
https://github.com/bobmagicii/vscode-auto-fold
fold vscode
Last synced: 3 months ago
JSON representation
A Visual Studio Code extension to automatically fold code if a magic comment is found.
- Host: GitHub
- URL: https://github.com/bobmagicii/vscode-auto-fold
- Owner: bobmagicii
- Created: 2017-01-11T00:42:14.000Z (about 9 years ago)
- Default Branch: redux
- Last Pushed: 2023-03-06T18:42:19.000Z (almost 3 years ago)
- Last Synced: 2025-04-07T03:35:41.574Z (9 months ago)
- Topics: fold, vscode
- Language: TypeScript
- Size: 134 KB
- Stars: 6
- Watchers: 1
- Forks: 7
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
> This is the new branch that is getting rewritten.
>
> * Try to solve the various issues people found over time.
> * Typescript.
> * Better Engineering.
Auto Fold for Visual Studio Code
================================================================================
This extension allows you to configure multiple methods for automatically
folding a file when opened.
Method 1: Magic Comment
--------------------------------------------------------------------------------
The most simple way to get a file folding is to add a magic comment containing
the `"fold-level=n"` where `n` is an integer ranging from 0 to 9. All that
matters is that it is added to the file in a way that will not cause you syntax
or compile errors.
**C, PHP, JS, etc:**
> `// fold-level=2`
**Bash**
> `# fold-level=2`
**SQL**
> `-- fold-level=2`
*Note: The old version comment `vscode-fold` is still supported but considered
deprecated. You should migrate to the `fold-level` version because people had
expressed it making plugins for other editors to reuse these.*
Method 2: Configured By File Type
--------------------------------------------------------------------------------
> TODO
Method 3: Configured Default
--------------------------------------------------------------------------------
> TODO
Other Options
--------------------------------------------------------------------------------
> TODO: Auto Fold All Block Comments
> executeCommand('editor.foldAllBlockComments')
> https://github.com/bobmagicii/vscode-auto-fold/issues/21
> TODO: Auto Fold All Marker Regions
> executeCommand('editor.foldAllMarkerRegions')
> https://github.com/bobmagicii/vscode-auto-fold/issues/19
> TODO: Only Auto Fold Files Longer Than n Lines
> https://github.com/bobmagicii/vscode-auto-fold/issues/7