2012-10-16 05:06:45 +00:00
|
|
|
# lua's indent plugin doesn't work well partly with markers. Use hard-tab for some of this snippet.
|
2012-09-23 05:26:56 +00:00
|
|
|
snippet func
|
|
|
|
alias function
|
2012-10-16 05:06:45 +00:00
|
|
|
function ${1:function_name}(${2:argument})
|
|
|
|
${0:// body...}
|
|
|
|
end
|
2012-09-23 05:26:56 +00:00
|
|
|
|
|
|
|
snippet if
|
2012-09-27 02:02:30 +00:00
|
|
|
if (${1:true}) then
|
|
|
|
${0:$TM_SELECTED_TEXT}
|
|
|
|
end
|
2012-09-23 05:26:56 +00:00
|
|
|
|
|
|
|
snippet for
|
2012-09-27 02:02:30 +00:00
|
|
|
for ${2:i} = 0, ${1:Things} do
|
|
|
|
${0}
|
|
|
|
end
|
2012-09-23 05:26:56 +00:00
|
|
|
|
|
|
|
snippet forin
|
2012-09-27 02:02:30 +00:00
|
|
|
for ${2:k}, ${3:v} in ${1:ipairs(xs)} do
|
|
|
|
${0}
|
|
|
|
end
|
2012-10-16 05:06:45 +00:00
|
|
|
|
|
|
|
snippet print_table
|
|
|
|
abbr for k, v in ipairs(table) do
|
|
|
|
for (k, v) in ipairs(${1:table}) do
|
|
|
|
print(k, v)
|
|
|
|
end
|