Sublime Text 3 中空车把的快捷方式

Shortcut for empty Handlebars in Sublime Text 3

我在 Sublime Text 中对 erb 标签使用以下快捷方式:

{ "keys": ["option+."], "command": "erb", "context":
  [
    { "key": "selector", "operator": "equal", "operand": "text.html.ruby, text.haml, source.yaml, source.css, source.scss, source.js, source.coffee" }
  ]
}

谁能帮我创建一个快捷方式来显示空的 Handlebars(Ember 应用程序),以便通过按 option + / 我可以生成 {{ }}(space 创建的中间是胡萝卜开始的地方,用于输入文本)。

我已经在使用 https://github.com/daaain/Handlebars,但此软件包不会生成空车把。

谢谢!

您可以使用 insert_snippet 命令执行此操作:

{
    "keys": ["option+/"],
    "command": "insert_snippet",
    "args": { "contents": "{{  }}" },
    "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.ruby, text.haml, source.yaml, source.css, source.scss, source.js, source.coffee" } ]
},

参考:

Sublime Text > Unofficial Docs > Snippets