让Sublime Text3支持新建.vue高亮显示模板

     首先要使用Package Control,安装要好 Vue Syntax Highlight和sublimetmpl插件.

1, 在Packages\SublimeTmpl\templates目录下新建vue.tmpl 文件,vue.tmpl模板内容为

 <template>

    <div>
    </div>
</template>
<script>
</script>
<style>
xport default {
  name:
  components: {
  }
}
</style>

2. 在sublime的菜单栏打开 Preferences>Package Settings>SublimeTmpl>Commands-defult在[ ]里内容后面粘贴以下配置

 ,  {

        "caption": "Tmpl: Create vue", "command": "sublime_tmpl",
        "args": {"type": "vue"}
    }

 3. 在sublime的菜单栏打开 Preferences>Package Settings>SublimeTmpl>setting-defult在[ ]里内容后面粘贴以下配置

打开Vue Syntax Highlight文件夹,找到Vue Component.sublime-syntax.cache文件,后面的配置里的路径要与它们的名称对应上

 ,

    "vue": {
    "syntax": "Packages/Vue Syntax Highlight/Vue Component.tmLanguage",
    "extension": "vue"
    }

 4. 在sublime的菜单栏打开 Preferences>Package Settings>SublimeTmpl>Key Bindings-defult在[ ]里内容后面粘贴以下配置

 ,{

      "keys": ["ctrl+alt+e"], "command": "sublime_tmpl",

        "args": {"type": "vue"}, "context": [{"key": "sublime_tmpl.vue"}]
    }

 配置完后,按ctrl+alt+e,就可以新建vue,并高亮显示

posted @ 2019-07-05 11:05  无胆快乐  阅读(422)  评论(0编辑  收藏  举报