让Sublime Text3支持新建.vue模板
1.首先安装好SublimeTmpl插件2.在C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Packages\SublimeTmpl\templates目录下新建vue.tmpl 文件3.vue.tmpl模板内容为<template&g
1.首先安装好SublimeTmpl及Vue Syntax Highlight插件,安装方式请查看下面的链接
SublimeTmpl:https://blog.csdn.net/lihefei_coder/article/details/80871682
Vue Syntax Highlight:https://blog.csdn.net/lihefei_coder/article/details/80871680
2.在C:\xxx\Administrator\AppData\Roaming\Sublime Text 3\Packages\SublimeTmpl\templates目录下新建vue.tmpl 文件
3.vue.tmpl模板内容为
<template>
</template>
<script>
</script>
<style>
</style>
4.在sublime的菜单栏打开 Preferences>Package Settings>SublimeTmpl>Commands-User,在[ ]里内容后面粘贴以下配置
,{
"caption": "Tmpl: Create vue", "command": "sublime_tmpl",
"args": {"type": "vue"}
}
5.在sublime的菜单栏打开 Preferences>Package Settings>SublimeTmpl>Key Bindings-User,在里面粘贴以下配置
,{
"keys": ["ctrl+alt+v"],
"command": "sublime_tmpl",
"args":
{
"type": "vue"
},
"context": [
{
"key": "sublime_tmpl.vue"
}]
}
6.在sublime的菜单栏打开 Preferences>Package Settings>SublimeTmpl>Menu-Default,在里面粘贴以下配置
,{
"id": "vue",
"caption": "VUE",
"command": "sublime_tmpl",
"args": {
"type": "vue"
}
}
7.新建的vue文件是纯文本格式没有高亮语法,在sublime的菜单栏打开 Preferences>Package Settings>SublimeTmpl>Settings - Default,粘贴对应好的配置
这个地方需要绑定vue语法,找到语法文件夹位置,我本机的为:
C:\Users\Administrator\AppData\Local\Sublime Text 3\Cache\Vue Syntax Highlight
打开Vue Syntax Highlight文件夹,找到Vue Component.sublime-syntax.cache文件,后面的配置里的路径要与它们的名称对应上
,
"vue": {
"syntax": "Packages/Vue Syntax Highlight/Vue Component.tmLanguage",
"extension": "vue"
}
7.按快捷键ctrl+alt+v
,创建高亮模板大功告成
更多推荐
所有评论(0)