diff options
| author | Vito G. Graffagnino <vito@graffagnino.xyz> | 2022-08-30 16:06:22 +0100 |
|---|---|---|
| committer | Vito G. Graffagnino <vito@graffagnino.xyz> | 2022-08-30 16:06:22 +0100 |
| commit | f1eabbaa1b4ff1836d0ee8335b31d009203f3775 (patch) | |
| tree | bbe77eacaef8ab8a5999e517c3006973c9e3e44c /luasnip_snippets/lua.json | |
| parent | 823302458ec6c53455a3f34674415c43ce6a3187 (diff) | |
fixed zathura integration with texlab using nvim-texlabconfig
Diffstat (limited to 'luasnip_snippets/lua.json')
| -rw-r--r-- | luasnip_snippets/lua.json | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/luasnip_snippets/lua.json b/luasnip_snippets/lua.json new file mode 100644 index 0000000..86f95e3 --- /dev/null +++ b/luasnip_snippets/lua.json @@ -0,0 +1,129 @@ +{ + "#!": { + "prefix": "#!", + "description": "#!/usr/bin/env lua", + "body": [ + "#!/usr/bin/env lua", + "$0" + ], + "luasnip": { + "priority": -50 + } + }, + "forp": { + "prefix": "forp", + "description": "pair for loop", + "body": [ + "for ${1:name},${2:val} in pairs(${3:table_name}) do", + "\t$0", + "end" + ] + }, + "fori": { + "prefix": "fori", + "description": "ipair for foop", + "body": [ + "for ${1:idx},${2:val} in ipairs(${3:table_name}) do", + "\t$0", + "end" + ] + }, + "do": { + "prefix": "do", + "description": "do block", + "body": [ + "do", + "\t$0", + "end" + ] + }, + "repeat": { + "prefix": "repeat", + "description": "repeat loop", + "body": [ + "repeat", + "\t$1", + "until $0" + ] + }, + "while": { + "prefix": "while", + "description": "while loop", + "body": [ + "while $1 do", + "\t$0", + "end" + ] + }, + "if": { + "prefix": "if", + "description": "if statement", + "body": [ + "if $1 then", + "\t$0", + "end" + ] + }, + "ife": { + "prefix": "ife", + "description": "if/else statement", + "body": [ + "if $1 then", + "\t$2", + "else", + "\t$0", + "end" + ] + }, + "eif": { + "prefix": "eif", + "description": "if/elseif statement", + "body": [ + "if $1 then", + "\t$2", + "elseif $3 then", + "\t$0", + "end" + ] + }, + "eife": { + "prefix": "eife", + "description": "if/elseif/else statement", + "body": [ + "if $1 then", + "\t$2", + "elseif $3 then", + "\t$4", + "else", + "\t$0", + "end" + ] + }, + "pcall": { + "prefix": "pcall", + "description": "pcall statement", + "body": [ + "local ok, err = pcall(${1:your_function})", + "if not ok then", + "\thandler(${2:ok, err})", + "${3:else", + "\tsuccess(${4:ok, err})", + "}end" + ] + }, + "local": { + "prefix": "local", + "description": "local x = 1", + "body": "local ${1:x} = ${0:1}" + }, + "use": { + "prefix": "use", + "description": "Use", + "body": "use { '$1' \\}" + }, + "req": { + "prefix": "req", + "description": "Require", + "body": "require('$1')" + } +} |
