This extension for VS Code let's you:
- Use the folding feature of VS Code to define arbitrary and named folding regions
- Define headlines for better code navigation and highlight significant points
- Navigate faster in your code using region labels and headlines in the navigation tree view
- Configure the marker colors for region labels and headlines in the extension settings
- Add comments in marker colors. These comments do not appear in the navigation tree view
- Each region marker must be on a separate line and start with
//#for JavaScript/TypeScript or##for Shell scripts. - Each marker is expected to contain a region label that is used to build the navigation tree view with the hierarchy of nested regions. Each region start marker is expected to have a corresponsing region end marker with the same region label.
You can use the following markers to define named folding regions:
| Start marker (JS/TS) | Start marker (Shell) | End marker (JS/TS) | End marker (Shell) | Suggested purpose |
|---|---|---|---|---|
//#{* |
###{* |
//#*} |
##*} |
Data types, structures, ... |
//#{ |
###{ |
//#} |
##} |
Variables, objects, instances, ... |
//#[ |
##[ |
//#] |
##] |
Arrays, lists, collections, tables, mappings, ... |
//#( |
##( |
//#) |
##) |
Functions, methods, procedures, ... |
//#< |
##< |
//#> |
##> |
General purpose sections or regions |
- You can use the markers as you like, the above purpose for the folding regions is only a suggestion.
- The named regions will show in the navigation tree view where you can collapse/expand the regions and navigate to them by the region label.
- You can define headlines on three levels that will show in the navigation tree view where you can navigate to them by the headline title.
| Marker (JS/TS) | Marker (Shell) | Headline |
|---|---|---|
//#1 |
##1 |
Headline level 1 |
//#2 |
##2 |
Headline level 2 |
//#3 |
##3 |
Headline level 3 |
- You can add comments in marker colors. These comments do not appear in the navigation tree view.
| Marker (JS/TS) | Marker (Shell) | Color |
|---|---|---|
//-1 |
##-1 |
Headline level 1 color |
//-2 |
##-2 |
Headline level 2 color |
//-3 |
##-3 |
Headline level 3 color |
//-{* |
##-{* |
{* *} region color |
//-{ |
##-{ |
{ } region color |
//-( |
##-( |
( ) region color |
//-[ |
##-[ |
[ ] region color |
//-< |
##-< |
< > region color |
- You can navigate faster in your code using region labels and headlines in the navigation tree view.
- You build the navigation tree explicitly by defining named regions and headlines of significance.
- To open the view, go to View | Open View... and search for
Fold More
Currently supported languages:
- JavaScript (C-style line-comments starting with
//) - TypeScript (C-style line-comments starting with
//) - Shell Script (line-comments starting with
#)
You can configure the marker colors for region labels and headlines in the extension settings:
-
Open the Settings and search for
foldmore -
Click on
Edit settings.jsonto edit the styles (syntax and icon colors)
Package the extension into a .vsix file:
npm install
npx @vscode/vsce packageThis creates vscode-foldmore-<version>.vsix in the project root.
See the Change Log



