Skip to content

Commit

Permalink
Merge pull request #11 from rm-code/snippets
Browse files Browse the repository at this point in the history
Add snippet for creating a local function
  • Loading branch information
FireZenk committed May 17, 2015
2 parents 22f40fc + ff6f1af commit f3c8495
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {} |
Expand Down
3 changes: 3 additions & 0 deletions snippets/language-lua.cson
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand Down

0 comments on commit f3c8495

Please sign in to comment.