Insert code snippet from file (and automatically fold regions).
Usage
Add your snippets (title and directory) to settings.json by setting snippet-from-file.snippets
Directories should be specified by an absolute path
or you can set snippet-from-file.snippetbasedir and specify by a relative path if all snippets are in the same directory.
{
"snippet-from-file.snippets": {
"SNIPPET TITLE 1": "/ANY/ABSOLUTE/PATH/snippet1.hpp",
"SNIPPET TITLE 2": "/ANY/ABSOLUTE/PATH2/snippet2.hpp",
...
}
}
Reload VSCode
Open command palette (Press F1 or Ctrl-Shift-P)
Type snippet-from-file and select below:
snippet-from-file: Insert snippet: Just insert snippet from file
snippet-from-file: Insert snippet and fold all regions: Insert snippet and fold regions
Choose your snippet by typing your snippet title
Done!
Extension Settings
Configure extensinon settings by editing settings.json.
snippet-from-file.snippets: Configure titles and directories of your snippets
Optional Settings
snippet-from-file.snippetbasedir: Load snippet from this directory
snippet-from-file.addregion: Add the region delimiter before/after your snippet
snippet-from-file.beginregion: The region delimiter for each language extension before your snippet (string <SNIPPETTITLE> will be replaced to your snippet title)
snippet-from-file.endregion: The region delimiter for each language extension after your snippet (string <SNIPPETTITLE> will be replaced to your snippet title)
snippet-from-file.addregionexcept: Specify the snippet (by directory) that you don't want to add the region delimiter