3axap4eHko / file-templates-manager

VSCode file templates manager extension
https://marketplace.visualstudio.com/items?itemName=3axap4eHko.file-templates-manager
12 stars 6 forks source link
template templates vscode vscode-extension

File Templates Manager for VSCode

File Templates Manager for VSCode allows you to manage your file templates and generate files from them.

:heart: Like it? :coffee: Donate

Screen Cast

Features

File Template Manager is powerful extension with following features that improve your productivity and do routine work for you.

Manage file template

Explorer

Template Picker

Interactive integrated doT template engine

Full Documentation of doT template engine


Variables available by default

Evaluation and interpolation example for HTML file

{{ for(let i = 0; i < 10; i++ ) }}
<div>Item {{=i}}</div>

result is

<div>Item 0</div>
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
<div>Item 5</div>
<div>Item 6</div>
<div>Item 7</div>
<div>Item 8</div>
<div>Item 9</div>

Select prompt example for C# language file

using System;

{{#def.select('TYPE', 'Select file type', ['class','interface','struct','enum'])}}
/*
  {{=$.NAME}} {{=$.TYPE}}
 */
public {{=$.TYPE}} {{=$.NAME}}
{

}

you will see a prompt

Select value

and get result for class type

using System;

/*
  CSharp class
 */
public class CSharp {

}

tsconfig.json example file

{{#def.select('MODULE', 'Specify module code generation', ['none','commonjs','amd','system','umd','es6','es2015','esnext'])}}
{{#def.select('TARGET', 'Specify ECMAScript target version', ['es3','es6','es2016','es2017','esnext'])}}
{{#def.confirm('SOURCE_MAP', 'Should generate corresponding .map file?')}}
{
  "compilerOptions": {
      "module": "{{=$.MODULE}}",
      "target": "{{=$.TARGET}}",
      "sourceMap": {{=$.SOURCE_MAP}}
  },
  "exclude": [
      "node_modules"
  ]
}

Extension Settings

This extension contributes the following settings:

License

The MIT License Copyright (c) 2019 Ivan Zakharchanka