Region Fold

Region Fold enables custom code region folding and highlighting in any file type.
Features
- 📑 Custom Folding: Collapse or expand any block wrapped between
// region and // endregion .
- 🎨 Configurable Highlighting: Lines with region markers are highlighted (default: green).
- ⬆️ Fold ↑ Command: A CodeLens appears above each
// endregion for one-click folding.
Installation
- Open the Extensions panel (
Ctrl+Shift+X / ⌘+Shift+X ).
- Search for Region Fold and click Install.
Or install manually:
npm install -g vsce
vsce package
code --install-extension region-fold-extension-0.0.3.vsix
Usage
- Add region markers in your code:
// region MySection
// ... code ...
// endregion
- Click the folding arrow (▾/▸) beside
// region or the Fold ↑ link above // endregion .
- Use keyboard shortcuts:
- Fold:
Ctrl+Shift+[ / ⌘+Option+[
- Unfold:
Ctrl+Shift+] / ⌘+Option+]
- Fold All:
Ctrl+K Ctrl+0
- Unfold All:
Ctrl+K Ctrl+J
Configuration
Customize in Settings (Ctrl+, / ⌘+, ) under Extensions → Region Fold:
Setting |
Type |
Default |
Description |
regionFold.markerColor |
string |
green |
CSS color for region marker highlighting |
Commands
Run via Command Palette (Ctrl+Shift+P / ⌘+Shift+P ):
- Region Fold: Fold Up Region (
regionFold.foldUp ) — instantly collapse the surrounding region.
Contributing
- Fork and clone:
git clone https://github.com/your-name/region-fold-extension.git
- Install:
npm install
- Compile:
npm run compile
- Launch in VS Code: press F5 to start the Extension Development Host.
- Submit a pull request.
License
MIT © Your Name
Happy folding!
| |