Skip to content

Instantly share code, notes, and snippets.

@abaez
Last active December 11, 2015 06:49
Show Gist options
  • Save abaez/4562094 to your computer and use it in GitHub Desktop.
Save abaez/4562094 to your computer and use it in GitHub Desktop.
Lua: Sublime Snippets
<snippet>
<content><![CDATA[
function(${1:...})
${2:--body}
end
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>functiona</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.lua</scope> <!--no need since using directory for scope ;) -->
<description>anonymous function</description>
</snippet>
<snippet>
<content><![CDATA[
getmetatable(${1:metatable})
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>getmetatable</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.lua</scope> <!-- no need since using directory for scope ;) -->
</snippet>
<snippet>
<content><![CDATA[
if ${1:true} then
${2:--body}
end
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>if</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.lua</scope>
<description>if Conditional</description>
</snippet>
<snippet>
<content><![CDATA[
if ${1:true} then
${2:--body}
else
${3:--body}
end
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ife</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.lua</scope>
<description>if..else Conditional</description>
</snippet>
<snippet>
<content><![CDATA[
if ${1:true} then
${2:--body}
elseif ${3:true} then
${4:--body}
else
${5:--body}
end
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ifee</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.lua</scope>
<description>if..else Conditional</description>
</snippet>
<snippet>
<content><![CDATA[
repeat
${1:--body}
until ${2:true}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>repeat</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.lua</scope>
<description>repeat..until Loop</description>
</snippet>
<snippet>
<content><![CDATA[
setmetatable(${1:table}, ${2:metatable})
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>setmetatable</tabTrigger>,
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.lua</scope> <!--no need since using directory for scope ;)-->
</snippet>
<snippet>
<content><![CDATA[
while ${1:true} do
${2:--body}
end
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>while</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.lua</scope>
<description>while Loop</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment