ditto in lua and vim/vital

This commit is contained in:
ujihisa 2012-10-25 09:12:39 -07:00
parent 43247731b7
commit b01091afd7
2 changed files with 9 additions and 2 deletions

View File

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

View File

@ -4,6 +4,7 @@ abbr vital#of('...')
snippet vital_of
abbr let s:V = vital#of('...')
options head
let ${1:s:V} = vital#of('${2:vital}')
snippet vital_import_without_let
@ -21,6 +22,7 @@ abbr s:V.load('...')
snippet vital_load
abbr call s:V.load('...')
options head
call ${1:s:V}.load('${2:Module}')
# FAQ