Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@unisnips/unisnips

hikerpig12MIT0.8.0TypeScript support: included

cli of unisnips project, convert ultisnips snippet to vscode/atom and other targets

unisnips, ultisnips

readme

Unisips

Unisnips is a set of tools to parse and generate expandable snippets, aiming to be the bridge between different editor/plugin/code-exapand-apps. It parses snippet sources (so far only a subset of UltiSnips is supported) and converts them to different targets.

You can keep only one set of expressive code templates - AKA snippets - and free yourself the chore of rewriting snippets to fit specifications of different platforms.

:construction: Still under active development, feel free to open issues.

See the demo site

:sparkles: Features

Parses source to a list of interchangable data for further use

See the demo site's DEBUG panel.

Supported sources

UltiSnips

  1. Positional placholder (aka 'TabStop' in UltiSnips)
snippet subsec "most common and simple"
---------------- $1 ----------------------
----------------end $1 -------------------
endsnippet

snippet with_default "with default value"
function ${1:name} {
  ${2://body}
}
endsnippet

snippet nested "nested tabstop"
${0:outer and ${1://inner}}
endsnippet
  1. 'VISUAL' placeholder
snippet ret  "return value"
ret ${VISUAL}
endsnippet
  1. script code block
snippet test_shell "shell code"
should print date: `! date`
endsnippet

snippet test_js "javascript code"
should print date: `!js new Date()`
endsnippet

Supported targets

Usage

Node cli

Install

npm i -g @unisnips/unisnips
# or
yarn global add @unisnips/unisnips

Example

unisnips convert --target vscode -i ~/.vim/Ultisnips/typescript.snippets -o ~/vscodesnippets/typescript.json

Roadmaps

  • Port a subset of UltiSnips parser to TypeScript, enable some basic and mostly used features

  • Add more builtin variables, may be useful in some targets (such as vscode's $CURRENT_YEAR)

  • Parses transformers and convert them to vscode

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.8.0 (2020-02-09)

Note: Version bump only for package @unisnips/unisnips

0.7.3 (2020-02-09)

Note: Version bump only for package @unisnips/unisnips

0.7.2 (2020-02-07)

Note: Version bump only for package @unisnips/unisnips

0.7.1 (2020-02-05)

Note: Version bump only for package @unisnips/unisnips

0.6.0-alpha.0 (2020-01-25)

Features

  • [jetbrains] :sparkles: Add generator for jetbrain's live template (7da6bf9)

0.3.0 (2020-01-05)

Bug Fixes

  • [atom] :bug: unquoted prefix (f77d13d)

Features

  • [unisnips] more friendly log (81a7c49)

0.2.3 (2020-01-03)

Note: Version bump only for package @unisnips/unisnips

0.2.2 (2020-01-03)

Bug Fixes