Skip to content

1.8.8

Compare
Choose a tag to compare
@github-actions github-actions released this 30 Oct 15:43
  • You can now use Regular Expression literals in snippet triggers! e.g. The regex snippet

    {trigger: "([A-Za-z])(\\d)", replacement: "[[0]]_{[[1]]}", options: "rA"}

    will expand x2 to x_{2}.
    The same snippet can now be written using a RegExp literal as

    {trigger: /([A-Za-z])(\d)/, replacement: "[[0]]_{[[1]]}", options: "A"}

    .

  • You can now set regex flags in a snippet using the flag property on a snippet, e.g.

    { trigger: "foo", replacement: "bar", options: "rA", flags: "i" },

    will replace "foo", "FOO", and "fOo" with "bar".

  • For power users: you can now treat snippet files as javascript modules, with the snippets array being the default export (#219 by @duanwilliam). For example,

    const SHORT_SYMBOL = "to|pm|mp"
    export default [
      { trigger: `([^\\\\])(${SHORT_SYMBOL})`, replacement: "[[0]]\\[[1]]", options: "rmA" },
    ]

    is now a valid snippet file. See #219 for more information.

  • Improved setting description for snippet file location.