Mac
菜单栏 -> Tools -> Developer -> new snippet…
新文件的内容
<snippet> <content><![CDATA[ Hello, ${1:this} is a ${2:snippet}. ]]></content> <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <!-- <tabTrigger>hello</tabTrigger> --> <!-- Optional: Set a scope to limit where the snippet will trigger --> <!-- <scope>source.python</scope> --> </snippet>
修改第三行内容
<snippet> <content><![CDATA[ String ${1} ]]></content> <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <tabTrigger>str</tabTrigger> <!-- Optional: Set a scope to limit where the snippet will trigger --> <scope>source.java</scope> </snippet>
1、${1} 进入页面后, 光标移入的位置
2、<tabTrigger>str</tabTrigger>
tab触发的标识 输入 str + tab 自动补全 为 String
3、<scope>source.java</scope>
生效文件,此处在java文件生效
4、保存文件为 str.sublime-snippet
回到java文件,输入 str + tab 自动补全 为 String
参考