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/perl.json | |
| parent | 823302458ec6c53455a3f34674415c43ce6a3187 (diff) | |
fixed zathura integration with texlab using nvim-texlabconfig
Diffstat (limited to 'luasnip_snippets/perl.json')
| -rw-r--r-- | luasnip_snippets/perl.json | 172 |
1 files changed, 172 insertions, 0 deletions
diff --git a/luasnip_snippets/perl.json b/luasnip_snippets/perl.json new file mode 100644 index 0000000..edbd3c2 --- /dev/null +++ b/luasnip_snippets/perl.json @@ -0,0 +1,172 @@ +{ + "ife": { + "prefix": "ife", + "description": "Conditional if..else (ife)", + "body": [ + "if ($1) {", + "\t${2:# body...}", + "\\}", + "else {", + "\t${3:# else...}", + "\\}", + "" + ], + "luasnip": { + "priority": -50 + } + }, + "ifee": { + "prefix": "ifee", + "description": "Conditional if..elsif..else (ifee)", + "body": [ + "if ($1) {", + "\t${2:# body...}", + "\\}", + "elsif ($3) {", + "\t${4:# elsif...}", + "\\}", + "else {", + "\t${5:# else...}", + "\\}", + "" + ] + }, + "xunless": { + "prefix": "xunless", + "description": "Conditional one-line (unless)", + "body": [ + "${1:expression} unless ${2:condition};", + "" + ] + }, + "xif": { + "prefix": "xif", + "description": "Conditional one-line (xif)", + "body": [ + "${1:expression} if ${2:condition};", + "" + ] + }, + "sub": { + "prefix": "sub", + "description": "Function (sub)", + "body": [ + "sub ${1:function_name} {", + "\t${2:# body...}", + "\\}", + "" + ] + }, + "xfore": { + "prefix": "xfore", + "description": "Loop one-line (xforeach)", + "body": [ + "${1:expression} foreach @${2:array};", + "" + ] + }, + "xwhile": { + "prefix": "xwhile", + "description": "Loop one-line (xwhile)", + "body": [ + "${1:expression} while ${2:condition};", + "" + ] + }, + "test": { + "prefix": "test", + "description": "Test", + "body": [ + "#!/usr/bin/env perl -w", + "", + "use strict;", + "use Test::More tests => ${1:1};", + "use ${2:ModuleName};", + "", + "ok(${3:assertion});", + "" + ] + }, + "eval": { + "prefix": "eval", + "description": "eval", + "body": [ + "local \\$@;", + "eval {", + "\t${1:# do something risky...}", + "\\};", + "if (my \\$${2:exception} = \\$@) {", + "\t${3:# handle failure...}", + "\\}", + "" + ] + }, + "for": { + "prefix": "for", + "description": "for", + "body": [ + "for (my \\$${1:var} = 0; \\$$1 < ${2:expression}; \\$$1++) {", + "\t${3:# body...}", + "\\}", + "" + ] + }, + "fore": { + "prefix": "fore", + "description": "foreach", + "body": [ + "foreach ${1:my \\$${2:x}} (@${3:array}) {", + "\t${4:# body...}", + "\\}", + "" + ] + }, + "if": { + "prefix": "if", + "description": "if", + "body": [ + "if ($1) {", + "\t${2:# body...}", + "\\}", + "" + ] + }, + "slurp": { + "prefix": "slurp", + "description": "slurp", + "body": [ + "my \\$${1:var} = do { local \\$/ = undef; open my \\$fh, '<', ${2:\\$file}; <\\$fh> \\};", + "" + ] + }, + "unless": { + "prefix": "unless", + "description": "unless", + "body": [ + "unless ($1) {", + "\t${2:# body...}", + "\\}", + "" + ] + }, + "while": { + "prefix": "while", + "description": "while", + "body": [ + "while ($1) {", + "\t${2:# body...}", + "\\}", + "" + ] + }, + "until": { + "prefix": "until", + "description": "until", + "body": [ + "until ($1) {", + "\t${2:# body...}", + "\\}", + "" + ] + } +} |
