emmet的snippet在vs code中配置问题

1.刚换编辑器vs code
2.进行一番配置
3.由于项目中的前端代码放在Velocity(.vm)模板中
4.但是内置的emmet不支持.vm格式的展开
5.于是查看有没有开放自定义配置,并没有
6.于是找到源文件C:\Program Files (x86)\Microsoft VS Code\resources\app\node_modules\emmet\lib\snippets.json
7.在下面加入一行

    "vm": {
      "filters": "vm",
      "extends": "html",
      "profile": "xml"
  }

8.然而还是不展开

9.stackoverflow上也没有搜到相关的问题,求解决办法
10.不要讨论重装一遍或者换编辑器之类的废话

阅读 7.2k
1 个回答
新手上路,请多包涵

你只完成了配置的一半。emmet在sublime中的配置比较坑。
在emmet key Bindings-User的文件中,复写这部分内容,新增"source.velocity"

    {
        "keys": [
            "tab"
        ],
        "command": "expand_abbreviation_by_tab",
        "context": [{
            "operand": "source.css, source.sass, source.less, source.scss, source.stylus, source.postcss, source.velocity,source.jade, text.jade, text.slim, text.xml, text.html - source, text.haml, text.scala.html, source string",
            "operator": "equal",
            "match_all": true,
            "key": "selector"
        }, {
            "operand": "storage.type.templatetag.django",
            "operator": "not_equal",
            "match_all": true,
            "key": "selector"
        }, {
            "match_all": true,
            "key": "selection_empty"
        }, {
            "operator": "equal",
            "operand": false,
            "match_all": true,
            "key": "has_next_field"
        }, {
            "operator": "equal",
            "operand": false,
            "match_all": true,
            "key": "setting.disable_tab_abbreviations"
        }, {
            "operand": false,
            "operator": "equal",
            "match_all": true,
            "key": "auto_complete_visible"
        }, {
            "match_all": true,
            "key": "is_abbreviation"
        }]
    }
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进