Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>VSTemplateNew to Visual Studio Code? Get it now.
VSTemplate

VSTemplate

theo-coder

|
147 installs
| (1) | Free
Create Templates for file
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSTemplate

VSTemplate let you create files and automatically fill them with some custom templates.

Features

  • Fill files with default boilerplate
  • Create custom files according to the template

demo

Variables

Here are some variables to use in configuration

VARIABLE Description
FILENAME The name of the initial file created (detected by the pattern wildcard)

Configuration

To configure your templates and file you have to edit the vscode configuration file

vstemplate.templates

Example Structure

{
    "React TS Component": [
        "import React from 'react';",
        "",
        "interface ${FILENAME}Props {",
        "};",
        "",
        "const ${FILENAME} = ({}: ${FILENAME}Props) => {",
        "    return <div>",
        "    </div>;",
        "};",
        "",
        "export default ${FILENAME};"
    ]
}

vstemplate.snippets

Example Structure

[
    {
        "pattern": "**/Components/*.tsx",
        "template": "React TS Component",
        "childs": [
            {
                "name": "${FILENAME}.stories.tsx",
                "template": "Some template..."
            }
        ]
    }
]

Credits

The idea came after seeing a PHPStorm feature...

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