diff --git a/README.md b/README.md index c22f4d3..6237de4 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Common snippets | ife | if else conditional | if value then --body... else --body... end | | ifn | if not conditional | if not value then --body... end | | ifne | if not else conditional | if not value then --body... else --body... end | +| lfun | local function | local function functionName (args) -- body... end | | loc | local variable definition shortcut | local x = 1 | | local | local variable definition | local x = 1 | | ltab | local table definition | local name = {} | diff --git a/snippets/language-lua.cson b/snippets/language-lua.cson index 0f51c82..d435f0a 100644 --- a/snippets/language-lua.cson +++ b/snippets/language-lua.cson @@ -32,6 +32,9 @@ 'for k,v in pairs()': 'prefix': 'forp' 'body': 'for ${1:k},${2:v} in pairs(${3:table_name}) do\n\t${0:-- body...}\nend' + 'local function': + 'prefix': 'lfun' + 'body': 'local function ${1:FunctionName} (${2:args})\n\t${0:-- body...}\nend' 'local variable definition': 'prefix': 'local' 'body': 'local ${1:x} = ${0:1}'