Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>compro-snippet-from-fileNew to Visual Studio Code? Get it now.
compro-snippet-from-file

compro-snippet-from-file

morioprog

|
29 installs
| (0) | Free
Insert snippets from file (and automatically fold regions)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

compro-snippet-from-file

Visual Studio Marketplace LICENSE

Features

Insert code snippet from file (and automatically fold regions).

Usage

  1. Specify an absolute path to your snippet folder by setting compro-snippet-from-file.snippetDirectory
  2. Reopen VSCode
  3. Open command palette, type compro-snippet-from-file and select below:
    • compro-snippet-from-file: Insert snippet: Just insert snippet from file
    • compro-snippet-from-file: Insert snippet and fold all regions: Insert snippet and fold regions
  4. Choose your snippet by typing the path of your snippet
  5. Done!

Extension Settings

Configure extensinon settings by editing settings.json.

  • compro-snippet-from-file.snippetDirectory: An absolute path to your snippet directory.

Optional Settings

  • compro-snippet-from-file.snippetExtensions: Specify extensions of your snippet files.
  • compro-snippet-from-file.addRegion: Whether to add the region delimiter before/after the snippet or not.
  • compro-snippet-from-file.beginRegion: The region delimiter for each language extension before your snippet (string <SNIPPETPATH> will be replaced to the path of your snippet).
  • compro-snippet-from-file.endregion: The region delimiter for each language extension after your snippet (string <SNIPPETPATH> will be replaced to the path of your snippet).
  • compro-snippet-from-file.addRegionExcept: Specify the snippet (by its relative path) that you don't want to add the region delimiter.
  • compro-snippet-from-file.ignoringDirectory: Ignore files under those directories.

Example

{
  "compro-snippet-from-file.snippetDirectory": "/ABSOLUTE/PATH/TO/SNIPPET/FOLDER",
  "compro-snippet-from-file.snippetExtensions": ["hpp", "py"],
  "compro-snippet-from-file.addRegion": true,
  "compro-snippet-from-file.beginRegion": {
    "cpp": "#pragma region <SNIPPETTITLE>",
    "py": "#region <SNIPPETTITLE>"
  },
  "compro-snippet-from-file.endRegion": {
    "cpp": "#pragma endregion",
    "py": "#endregion"
  },
  "compro-snippet-from-file.addRegionExcept": ["template/template.hpp"],
  "compro-snippet-from-file.ignoringDirectory": ["docs", "test"]
}

License

This extension releases under the MIT License.

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