自定义snippet
步骤1:tools->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>
步骤2:修改脚本如下
<snippet>
<content><![CDATA[
-- describe:
-- arguements:
-- return:
-- how to use:
function ${1:function_name}(${2:arg})
${3}
end
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>function %</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.lua</scope>
</snippet>
note:一个简易的函数补充功能,其他功能的扩展可以自己推敲。