Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Auto Region FolderNew to Visual Studio Code? Get it now.
Auto Region Folder

Auto Region Folder

DNEK

|
2,791 installs
| (2) | Free
Fold all regions automatically when open files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Auto Region Folder for Visual Studio Code

This extension folds all regions automatically when open files in Visual Studio Code.

Example of appearance

C++

Before

#pragma region header

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

#pragma endregion header

int main() {
  rep(i, 42) cout << i << endl;
}

After

#pragma region header

int main() {
  rep(i, 42) cout << i << endl;
}

Markdown

Before


- main content

<!-- #region trivial -->

- trivial content

<!-- #endregion trivial -->

After


- main content

<!-- #region trivial -->

etc

See The official docs.

Practical test

Open this file with Visual Studio Code and see the following region.

Test region

  • This region is automatically folded.

  • On the contrary, the region within the above code block of Markdown is not folded.

Author

  • dnek

License

This project is licensed under the MIT License - see the LICENSE file for details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft