logo
0
0
WeChat Login

使用

  1. 在该目录执行: npm i npm run compile

  2. 打开此文件夹,用 VS Code 按 F5 进入“扩展开发主机”。

  3. 在命令面板(Ctrl+Shift+P):

    • “Template: Insert from URL (GitHub/Gist)”
    • “Template: Insert from Preset”

URL 说明(degit 语法)

  • GitHub 仓库分支: user/repo#branch
  • 子目录: user/repo/path/to/subdir#branch
  • Gist: gist:username/gistid
  • 也支持 GitLab/Bitbucket(degit 支持的都行)

变量替换

插入完成后可输入: NAME=my-lib, DESC="Awesome utils" 模板里写 {{NAME}} / {{DESC}} 会被替换(文本类文件)。

配置

在 vscode settings.json 中配置 presets。

{ "templateInserter.presets": [ { "label": "Vue Lib", "source": "https://gist.githubusercontent.com/yefengwu/aa0ee34acc68bdfca98d6aa62f05033d/raw/81b4401f648fecb4822c36373f8c4a7660328a32/initial.sh", "dest": "." }, { "label": "VSCode Settings", "source": "yourname/templates/vscode-basic#main", "dest": ".vscode" } ], "templateInserter.overwritePolicy": "ask", "templateInserter.enableVarSubstitution": false }

About

A vscode plugin for insert template

140.00 KiB
0 forks0 stars1 branches0 TagREADMEMIT license
Language
TypeScript53.3%
JavaScript30.7%
Markdown10%
License5%
Others1%