Visual Studio Code Custom Folding Extension
This extension enhances the default code folding abilities of Visual Studio Code editor. Regions of code that you'd like to be folded can be wrapped with
The precise format of the comment depends on the language. For instance, for C-Style languages, regions are of the form:
For HTML style languages, you could define a foldable region with the following tags:
The extension also installs a command to wrap a
The extension provides configuration settings, allowing you to provide custom region tags for your language.
To provide a custom folding for your language create a settings in your vscode settings file (either user or workspace) that conforms to the following specification.
You can install the latest version of the extension is available on the Visual Studio Marketplace here.
Alternatively, open Visual Studio code, press
Default Folding Region (Preview)
New in version 1.0.7 is the notion of default folds. The feature is in preview, but when it is complete, default folds will define regions which will be collapsed whenever the file is opened. In the current preview version, default folds are only collapsed when the
You can create a default fold by creating a Regex expression which defines the default fold for the language of your choice in your settings file. The Regex is defined in the
In the following example, defined for the Markdown language, default folds are defined as regions in the following form:
The settings for this default fold are below:
Bugs and Features
The Changelog can be found here.
Please log any bugs on Github here.
If you have a new language that you've supported using the custom configuration, we'd love to incorporate it into the defaults for the extension. Please log an issue or a pull request on the repo here.
The source code is available on GitHub here.
View other extensions from Maptz