neosnippet.vim/autoload/neosnippet/snippets/lua.snip

34 lines
609 B
Plaintext
Raw Normal View History

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
2013-03-05 15:23:10 +00:00
abbr function name(args)...end
2012-10-25 16:12:39 +00:00
options word
2012-10-30 08:53:14 +00:00
function ${1:#:function_name}(${2:#:argument})
${0:TARGET}
2012-10-16 05:06:45 +00:00
end
2012-09-23 05:26:56 +00:00
snippet if
2012-10-25 16:12:39 +00:00
options head
2012-10-30 08:53:14 +00:00
if (${1:#:condition}) then
${0:TARGET}
end
2012-09-23 05:26:56 +00:00
snippet for
2012-10-25 16:12:39 +00:00
options head
2012-10-30 08:53:14 +00:00
for ${2:i} = 0, ${1:#:Things} do
${0:TARGET}
end
2012-09-23 05:26:56 +00:00
snippet forin
2012-10-25 16:12:39 +00:00
options head
for ${2:k}, ${3:v} in ${1:ipairs(xs)} do
2012-10-30 08:53:14 +00:00
${0:TARGET}
end
2012-10-16 05:06:45 +00:00
snippet print_table
2012-10-25 16:12:39 +00:00
options head
2012-10-16 05:06:45 +00:00
abbr for k, v in ipairs(table) do
2012-10-25 16:12:39 +00:00
for k, v in ipairs(${1:table}) do
2012-10-16 05:06:45 +00:00
print(k, v)
end
2012-10-30 08:53:14 +00:00