neosnippet.vim/autoload/neosnippet/snippets/lua.snip
2012-10-15 23:03:51 -07:00

28 lines
516 B
Plaintext

# lua's indent plugin doesn't work well partly with markers. Use hard-tab for some of this snippet.
snippet func
alias function
function ${1:function_name}(${2:argument})
${0:// body...}
end
snippet if
if (${1:true}) then
${0:$TM_SELECTED_TEXT}
end
snippet for
for ${2:i} = 0, ${1:Things} do
${0}
end
snippet forin
for ${2:k}, ${3:v} in ${1:ipairs(xs)} do
${0}
end
snippet print_table
abbr for k, v in ipairs(table) do
for (k, v) in ipairs(${1:table}) do
print(k, v)
end