Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snippet for creating a local function #11

Merged
merged 1 commit into from
May 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add snippet for creating a local function
  • Loading branch information
rm-code committed Apr 4, 2015
commit ff6f1af0db6b7350fd64bfe079957e82cdee7331
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