Convert Sublime and Textmate Snippets to Visual Studio Code Format
Last updated 4 years ago by digitaldrummerj .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install convert-snippets-to-vscode 
SYNC missed versions from official npm registry.

Convert Textmate or Sublime Code Snippets to VSCode

Based off the VSCode Yeoman generator, I have created a script to convert Textmate or Sublime snippets to a VSCode snippet json file. The intent is to be able to have multiple snippet language types in a single VSCode extension but the Yeoman template generator only does 1 snippet language.

One other difference from the VSCode Yeoman generator, is that if will recursively look through the given directory for the snippets.

Install the Converter

npm install convert-snippets-to-vscode
npm install -g convert-snippets-to-vscode

Run Converter

To launch the converter and be prompted for info simply type:

$ snippetToVsCode

Folder location that contains Text Mate (.tmSnippet) and Sublime snippets (.sublime-snippet)
? Folder name: c:\temp\Snippets\Css
? Output File Name: c:\temp\css.json 

To launch to convert and pass in command line arguments:

snippetToVsCode -s c:\temp\Snippets\Css -o c:\temp\css.json

Converter Output

A json file with the converted templates in the vscode format.

Take the generated file, add it to your VSCode Extension that you generated with VSCode Yeoman generator in the snippets directory.

Then update the package.json file in your VSCode Extension project with the new snippets file name and language that it supports.



Current Tags

  • 1.0.2                                ...           latest (4 years ago)

3 Versions

  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 5
Dependencies (3)
Dev Dependencies (0)
Dependents (2)

Copyright 2014 - 2017 © |