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 | |
| parent | 823302458ec6c53455a3f34674415c43ce6a3187 (diff) | |
fixed zathura integration with texlab using nvim-texlabconfig
Diffstat (limited to 'luasnip_snippets')
82 files changed, 8809 insertions, 0 deletions
diff --git a/luasnip_snippets/ada.json b/luasnip_snippets/ada.json new file mode 100644 index 0000000..2893309 --- /dev/null +++ b/luasnip_snippets/ada.json @@ -0,0 +1,360 @@ +{ + "wi": { + "prefix": "wi", + "description": "with", + "body": "with $1;$0", + "luasnip": { + "priority": -50 + } + }, + "ent": { + "prefix": "ent", + "description": "entry ... when", + "body": [ + "entry $1($2) when $3 is", + "begin", + "\t$0", + "end $1;" + ] + }, + "task": { + "prefix": "task", + "description": "task", + "body": [ + "task $1 is", + "\tentry $0", + "end $1;" + ] + }, + "taskb": { + "prefix": "taskb", + "description": "task body", + "body": [ + "task body $1 is", + "\t$2", + "begin", + "\t$0", + "end $1;" + ] + }, + "acc": { + "prefix": "acc", + "description": "accept", + "body": [ + "accept $1($2) do", + "\t$0", + "end $1;" + ] + }, + "prot": { + "prefix": "prot", + "description": "protected type", + "body": [ + "protected type $1($2) is", + "\t$0", + "end $1;" + ] + }, + "prob": { + "prefix": "prob", + "description": "protected body", + "body": [ + "protected body $1 is", + "\t$2", + "begin", + "\t$0", + "end $1;" + ] + }, + "gen": { + "prefix": "gen", + "description": "generic type", + "body": [ + "generic", + "\ttype $1 is $2;$0" + ] + }, + "ty": { + "prefix": "ty", + "description": "type", + "body": "type $1 is $2;$0" + }, + "tyd": { + "prefix": "tyd", + "description": "type with default value", + "body": [ + "type $1 is $2", + "\twith Default_Value => $3;$0" + ] + }, + "subty": { + "prefix": "subty", + "description": "subtype", + "body": "subtype $1 is $2;$0" + }, + "dec": { + "prefix": "dec", + "description": "declare block", + "body": [ + "declare", + "\t$1", + "begin", + "\t$0", + "end;" + ] + }, + "decn": { + "prefix": "decn", + "description": "declare named block", + "body": [ + "$1:", + "declare", + "\t$2", + "begin", + "\t$0", + "end $1;" + ] + }, + "ifex": { + "prefix": "ifex", + "description": "if expression", + "body": "if $1 then $2 else $0" + }, + "casex": { + "prefix": "casex", + "description": "case expression", + "body": [ + "case $1 is", + "\twhen $2 => $3,$0" + ] + }, + "fora": { + "prefix": "fora", + "description": "for all", + "body": "for all $1 ${2:in} $3 => $0" + }, + "fors": { + "prefix": "fors", + "description": "for some", + "body": "for some $1 ${2:in} $3 => $0" + }, + "if": { + "prefix": "if", + "description": "if", + "body": [ + "if $1 then", + "\t$0", + "end if;" + ] + }, + "ife": { + "prefix": "ife", + "description": "if ... else", + "body": [ + "if $1 then", + "\t$2", + "else", + "\t$0", + "end if;" + ] + }, + "el": { + "prefix": "el", + "description": "else", + "body": [ + "else", + "\t$0" + ] + }, + "eif": { + "prefix": "eif", + "description": "elsif", + "body": [ + "elsif $1 then", + "\t$0" + ] + }, + "wh": { + "prefix": "wh", + "description": "while", + "body": [ + "while $1 loop", + "\t$0", + "end loop;" + ] + }, + "nwh": { + "prefix": "nwh", + "description": "named while", + "body": [ + "$1:", + "while $2 loop", + "\t$0", + "end loop $1;" + ] + }, + "for": { + "prefix": "for", + "description": "for", + "body": [ + "for ${1:I} in $2 loop", + "\t$0", + "end loop;" + ] + }, + "fore": { + "prefix": "fore", + "description": "for each", + "body": [ + "for $1 of $2 loop", + "\t$0", + "end loop;" + ] + }, + "nfor": { + "prefix": "nfor", + "description": "named for", + "body": [ + "$1:", + "for ${2:I} in $3 loop", + "\t$0", + "end loop $1;" + ] + }, + "nfore": { + "prefix": "nfore", + "description": "named for each", + "body": [ + "$1:", + "for $2 of $3 loop", + "\t$0", + "end loop $1;" + ] + }, + "proc": { + "prefix": "proc", + "description": "procedure", + "body": [ + "procedure $1($2) is", + "\t$3", + "begin", + "\t$0", + "end $1;" + ] + }, + "procd": { + "prefix": "procd", + "description": "procedure declaration", + "body": "procedure $1;$0" + }, + "fun": { + "prefix": "fun", + "description": "function", + "body": [ + "function $1($2) return $3 is", + "\t$4", + "begin", + "\t$0", + "end $1;" + ] + }, + "fune": { + "prefix": "fune", + "description": "expression function", + "body": [ + "function $1 return $2 is", + "\t($3);$0" + ] + }, + "fund": { + "prefix": "fund", + "description": "function declaration", + "body": "function $1 return $2;$0" + }, + "ret": { + "prefix": "ret", + "description": "extended return", + "body": [ + "return $1 do", + "\t$0", + "end return;" + ] + }, + "rec": { + "prefix": "rec", + "description": "record", + "body": [ + "record", + "\t$0", + "end record;" + ] + }, + "case": { + "prefix": "case", + "description": "case", + "body": [ + "case $1 is", + "\twhen $2 => $3;$0", + "end case;" + ] + }, + "whe": { + "prefix": "whe", + "description": "when", + "body": "when $1 => $2;$0" + }, + "wheo": { + "prefix": "wheo", + "description": "when others", + "body": "when others => $1;$0" + }, + "lo": { + "prefix": "lo", + "description": "loop", + "body": [ + "loop", + "\t$0", + "end loop;" + ] + }, + "nlo": { + "prefix": "nlo", + "description": "named loop", + "body": [ + "$1:", + "loop", + "\t$0", + "end loop $1;" + ] + }, + "ex": { + "prefix": "ex", + "description": "exit when", + "body": "exit when $1;$0" + }, + "put": { + "prefix": "put", + "description": "Ada.Text_IO.Put", + "body": "Ada.Text_IO.Put($1);$0" + }, + "putl": { + "prefix": "putl", + "description": "Ada.Text_IO.Put_Line", + "body": "Ada.Text_IO.Put_Line($1);$0" + }, + "get": { + "prefix": "get", + "description": "Ada.Text_IO.Get", + "body": "Ada.Text_IO.Get($1);$0" + }, + "getl": { + "prefix": "getl", + "description": "Ada.Text_IO.Get_Line", + "body": "Ada.Text_IO.Get_Line($1);$0" + }, + "newline": { + "prefix": "newline", + "description": "Ada.Text_IO.New_Line", + "body": "Ada.Text_IO.New_Line(${1:1});$0" + } +} diff --git a/luasnip_snippets/all.json b/luasnip_snippets/all.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/all.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/bib.json b/luasnip_snippets/bib.json new file mode 100644 index 0000000..6f237c7 --- /dev/null +++ b/luasnip_snippets/bib.json @@ -0,0 +1,68 @@ +{ + "online": { + "prefix": "online", + "description": "Online resource", + "body": [ + "@online{${1:name},", + "\tauthor={${2:author}\\},", + "\ttitle={${3:title}\\},", + "\tdate={${4:date}\\},", + "\turl={${5:url}\\}", + "\\}", + "$0" + ], + "luasnip": { + "priority": -50 + } + }, + "article": { + "prefix": "article", + "description": "Article reference", + "body": [ + "@article{${1:name},", + "\tauthor={${2:author}\\},", + "\ttitle={${3:title}\\},", + "\tjournaltitle={${4:journal}\\},", + "\tvolume={${5:NN}\\},", + "\tnumber={${6:NN}\\},", + "\tyear={${7:YYYY}\\},", + "\tpages={${8:NN}--${9:NN}\\}", + "\\}", + "$0" + ] + }, + "book": { + "prefix": "book", + "description": "Book reference", + "body": [ + "@book{${1:name},", + "\tauthor={${2:author}\\},", + "\ttitle={${3:title}\\},", + "\tsubtitle={${4:subtitle}\\},", + "\tyear={${5:YYYY}\\},", + "\tlocation={${6:somewhere}\\},", + "\tpublisher={${7:publisher}\\},", + "\tpages={${8:NN}--${9:NN}\\}", + "\\}", + "$0" + ] + }, + "inb": { + "prefix": "inb", + "description": "In Book reference", + "body": [ + "@inbook{${1:name},", + "\tauthor={${2:author}\\},", + "\ttitle={${3:title}\\},", + "\tsubtitle={${4:subtitle}\\},", + "\tbooktitle={${5:book}\\},", + "\teditor={${6:editor}\\},", + "\tyear={${7:YYYY}\\},", + "\tlocation={${8:somewhere}\\},", + "\tpublisher={${9:publisher}\\},", + "\tpages={${10:NN}--${11:NN}\\}", + "\\}", + "$0" + ] + } +} diff --git a/luasnip_snippets/bindzone.json b/luasnip_snippets/bindzone.json new file mode 100644 index 0000000..2ccda11 --- /dev/null +++ b/luasnip_snippets/bindzone.json @@ -0,0 +1,7 @@ +{ + "A": { + "prefix": "A", + "description": "Insert A Record", + "body": "${1:hostname}\tIN\t\tA\t${2:ip}" + } +} diff --git a/luasnip_snippets/blade.json b/luasnip_snippets/blade.json new file mode 100644 index 0000000..e624f8b --- /dev/null +++ b/luasnip_snippets/blade.json @@ -0,0 +1,79 @@ +{ + "break": { + "prefix": "break", + "description": "@break", + "body": "@break", + "luasnip": { + "priority": -49 + } + }, + "each": { + "prefix": "each", + "description": "@each directive", + "body": "@each('$1', \\$$2, '$3')" + }, + "else": { + "prefix": "else", + "description": "@else directive", + "body": "@else" + }, + "extends": { + "prefix": "extends", + "description": "@extends directive", + "body": "@extends('$1')" + }, + "include": { + "prefix": "include", + "description": "@include directive", + "body": "@include('$1')" + }, + "includeIf": { + "prefix": "includeIf", + "description": "@includeIf directive", + "body": "@includeIf('$1')" + }, + "inject": { + "prefix": "inject", + "description": "@inject directive", + "body": "@inject('$1', '$2')" + }, + "lang": { + "prefix": "lang", + "description": "@lang directive", + "body": "@lang('$1')" + }, + "section": { + "prefix": "section", + "description": "@section directive", + "body": "@section('$1')" + }, + "show": { + "prefix": "show", + "description": "@show directive", + "body": "@show" + }, + "verbatim": { + "prefix": "verbatim", + "description": "@verbatim directive", + "body": [ + "@verbatim", + "\t${0:\\$VISUAL}", + "@endverbatim" + ] + }, + "yield": { + "prefix": "yield", + "description": "@yield directive", + "body": "@yield('$1')" + }, + "{": { + "prefix": "{", + "description": "{{ }} statement.", + "body": "{{ $1 \\}\\}" + }, + "{!": { + "prefix": "{!", + "description": "{!! !!} statement", + "body": "{!! $1 !!\\}" + } +} diff --git a/luasnip_snippets/c.json b/luasnip_snippets/c.json new file mode 100644 index 0000000..611d918 --- /dev/null +++ b/luasnip_snippets/c.json @@ -0,0 +1,27 @@ +{ + "def": { + "prefix": "def", + "description": "#define ...", + "body": "#define $1", + "luasnip": { + "priority": -50 + } + }, + "mark": { + "prefix": "mark", + "description": "#pragma mark (mark)", + "body": [ + "#if 0", + "${1:#pragma mark -", + "}#pragma mark $2", + "#endif", + "", + "$0" + ] + }, + "fund": { + "prefix": "fund", + "description": "function declaration", + "body": "${1:void} ${2:function_name}($3);" + } +} diff --git a/luasnip_snippets/coffee-jasmine.json b/luasnip_snippets/coffee-jasmine.json new file mode 100644 index 0000000..563b88e --- /dev/null +++ b/luasnip_snippets/coffee-jasmine.json @@ -0,0 +1,210 @@ +{ + "des": { + "prefix": "des", + "description": "Describe (coffee)", + "body": [ + "describe '${1:description}', ->", + "\t$0" + ], + "luasnip": { + "priority": -49 + } + }, + "it": { + "prefix": "it", + "description": "it (coffee)", + "body": [ + "it '${1:description}', ->", + "\t$0" + ] + }, + "bef": { + "prefix": "bef", + "description": "before each (coffee)", + "body": [ + "beforeEach ->", + "\t$0" + ] + }, + "aft": { + "prefix": "aft", + "description": "after each (coffee)", + "body": [ + "afterEach ->", + "\t$0" + ] + }, + "any": { + "prefix": "any", + "description": "any (coffee)", + "body": "jasmine.any($1)" + }, + "ru": { + "prefix": "ru", + "description": "runs (coffee)", + "body": [ + "runs ->", + "\t$0" + ] + }, + "wa": { + "prefix": "wa", + "description": "waits (coffee)", + "body": "waits($1)" + }, + "ex": { + "prefix": "ex", + "description": "expect (coffee)", + "body": "expect(${1:target})$0" + }, + "ee": { + "prefix": "ee", + "description": "expect to equal (coffee)", + "body": "expect(${1:target}).toEqual(${2:value})" + }, + "em": { + "prefix": "em", + "description": "expect to match (coffee)", + "body": "expect(${1:target}).toMatch(${2:pattern})" + }, + "eha": { + "prefix": "eha", + "description": "expect to have attribute (coffee)", + "body": "expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'})" + }, + "et": { + "prefix": "et", + "description": "expect to be truthy (coffee)", + "body": "expect(${1:target}).toBeTruthy()" + }, + "ef": { + "prefix": "ef", + "description": "expect to be falsy (coffee)", + "body": "expect(${1:target}).toBeFalsy()" + }, + "ed": { + "prefix": "ed", + "description": "expect to be defined (coffee)", + "body": "expect(${1:target}).toBeDefined()" + }, + "en": { + "prefix": "en", + "description": "expect to be null (coffee)", + "body": "expect(${1:target}).toBeNull()" + }, + "ec": { + "prefix": "ec", + "description": "expect to contain (coffee)", + "body": "expect(${1:target}).toContain(${2:value})" + }, + "ev": { + "prefix": "ev", + "description": "expect to be visible (coffee)", + "body": "expect(${1:target}).toBeVisible()" + }, + "eh": { + "prefix": "eh", + "description": "expect to be hidden (coffee)", + "body": "expect(${1:target}).toBeHidden()" + }, + "notx": { + "prefix": "notx", + "description": "expect not (coffee)", + "body": "expect(${1:target}).not$0" + }, + "note": { + "prefix": "note", + "description": "expect not to equal (coffee)", + "body": "expect(${1:target}).not.toEqual(${2:value})" + }, + "notm": { + "prefix": "notm", + "description": "expect not to match (coffee)", + "body": "expect(${1:target}).not.toMatch(${2:pattern})" + }, + "notha": { + "prefix": "notha", + "description": "expect to not have attribute (coffee)", + "body": "expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'})" + }, + "nott": { + "prefix": "nott", + "description": "expect not to be truthy (coffee)", + "body": "expect(${1:target}).not.toBeTruthy()" + }, + "notf": { + "prefix": "notf", + "description": "expect not to be falsy (coffee)", + "body": "expect(${1:target}).not.toBeFalsy()" + }, + "notd": { + "prefix": "notd", + "description": "expect not to be defined (coffee)", + "body": "expect(${1:target}).not.toBeDefined()" + }, + "notn": { + "prefix": "notn", + "description": "expect not to be null (coffee)", + "body": "expect(${1:target}).not.toBeNull()" + }, + "notc": { + "prefix": "notc", + "description": "expect not to contain (coffee)", + "body": "expect(${1:target}).not.toContain(${2:value})" + }, + "notv": { + "prefix": "notv", + "description": "expect not to be visible (coffee)", + "body": "expect(${1:target}).not.toBeVisible()" + }, + "noth": { + "prefix": "noth", + "description": "expect not to be hidden (coffee)", + "body": "expect(${1:target}).not.toBeHidden()" + }, + "s": { + "prefix": "s", + "description": "spy on (coffee)", + "body": "spyOn(${1:object}, \"${2:method}\")$0" + }, + "sr": { + "prefix": "sr", + "description": "spy on and return (coffee)", + "body": "spyOn(${1:object}, \"${2:method}\").andReturn(${3:arguments})" + }, + "st": { + "prefix": "st", + "description": "spy on and throw (coffee)", + "body": "spyOn(${1:object}, \"${2:method}\").andThrow(${3:exception})" + }, + "sct": { + "prefix": "sct", + "description": "spy on and call through (coffee)", + "body": "spyOn(${1:object}, \"${2:method}\").andCallThrough()" + }, + "scf": { + "prefix": "scf", + "description": "spy on and call fake (coffee)", + "body": "spyOn(${1:object}, \"${2:method}\").andCallFake(${3:function})" + }, + "esc": { + "prefix": "esc", + "description": "expect was called (coffee)", + "body": "expect(${1:target}).wasCalled()" + }, + "escw": { + "prefix": "escw", + "description": "expect was called with (coffee)", + "body": "expect(${1:target}).wasCalledWith(${2:arguments})" + }, + "notsc": { + "prefix": "notsc", + "description": "expect was not called (coffee)", + "body": "expect(${1:target}).wasNotCalled()" + }, + "noscw": { + "prefix": "noscw", + "description": "expect was not called with (coffee)", + "body": "expect(${1:target}).wasNotCalledWith(${2:arguments})" + } +} diff --git a/luasnip_snippets/coffee-react.json b/luasnip_snippets/coffee-react.json new file mode 100644 index 0000000..ceca925 --- /dev/null +++ b/luasnip_snippets/coffee-react.json @@ -0,0 +1,115 @@ +{ + "createClass": { + "prefix": "createClass", + "description": "React define Class", + "body": [ + "${1:classname}Class = React.createClass", + "\tdisplayName: \"$1\"", + "\trender: ->", + "\t\t$2", + "$1 = React.createFactory($1)" + ], + "luasnip": { + "priority": -49 + } + }, + "PropTypes": { + "prefix": "PropTypes", + "description": "React define propTypes", + "body": [ + "propTypes: ->", + "\t${1:myVar}: React.PropTypes.${2:type}${3:.isRequired}" + ] + }, + "propType": { + "prefix": "propType", + "description": "React propType (key/value)", + "body": [ + "${1:myVar}: React.PropTypes.${2:type}${3:.isRequired}", + "$4" + ] + }, + "setState": { + "prefix": "setState", + "description": "React setState", + "body": [ + "@setState", + "\t${1:myvar}: ${2:myvalue}", + "\t$3" + ] + }, + "getInitialState": { + "prefix": "getInitialState", + "description": "React define getInitialState", + "body": [ + "getInitialState: ->", + "\t${1:myvar}: ${2:myvalue}", + "\t$3" + ] + }, + "getDefaultProps": { + "prefix": "getDefaultProps", + "description": "React define getDefaultProps", + "body": [ + "getDefaultProps: ->", + "\t${1:myvar}: ${2:myvalue}", + "\t$3" + ] + }, + "componentWillMount": { + "prefix": "componentWillMount", + "description": "React define componentWillMount", + "body": [ + "componentWillMount: ->", + "\t$1" + ] + }, + "componentDidMount": { + "prefix": "componentDidMount", + "description": "React define componentDidMount", + "body": [ + "componentDidMount: ->", + "\t$1" + ] + }, + "componentWillReceiveProps": { + "prefix": "componentWillReceiveProps", + "description": "React define componentWillReceiveProps", + "body": [ + "componentWillReceiveProps: (nextProps) ->", + "\t$1" + ] + }, + "shouldComponentUpdate": { + "prefix": "shouldComponentUpdate", + "description": "React define shouldComponentUpdate", + "body": [ + "shouldComponentUpdate: (nextProps, nextState) ->", + "\t$1" + ] + }, + "componentWillUpdate": { + "prefix": "componentWillUpdate", + "description": "React define componentWillUpdate", + "body": [ + "componentWillUpdate: (nextProps, nextState) ->", + "\t$1" + ] + }, + "componentDidUpdate": { + "prefix": "componentDidUpdate", + "description": "React define componentDidUpdate", + "body": [ + "componentDidUpdate: (prevProps, prevState) ->", + "\t$1" + ] + }, + "componentWillUnmount": { + "prefix": "componentWillUnmount", + "description": "React define componentWillUnmount", + "body": [ + "componentWillUnmount: ->", + "\t$1" + ] + } +} diff --git a/luasnip_snippets/coffee.json b/luasnip_snippets/coffee.json new file mode 100644 index 0000000..88d097a --- /dev/null +++ b/luasnip_snippets/coffee.json @@ -0,0 +1,90 @@ +{ + "if": { + "prefix": "if", + "description": "If", + "body": [ + "if ${1:condition}", + "\t${0:# body...}" + ] + }, + "ife": { + "prefix": "ife", + "description": "If .. Else", + "body": [ + "if ${1:condition}", + "\t${2:# body...}", + "else", + "\t${3:# body...}" + ] + }, + "elif": { + "prefix": "elif", + "description": "Else if", + "body": [ + "else if ${1:condition}", + "\t${0:# body...}" + ] + }, + "ifte": { + "prefix": "ifte", + "description": "Ternary if", + "body": "if ${1:condition} then ${2:value} else ${3:other}" + }, + "unl": { + "prefix": "unl", + "description": "Unless", + "body": "${1:action} unless ${2:condition}" + }, + "fora": { + "prefix": "fora", + "description": "Array Comprehension", + "body": [ + "for ${1:name} in ${2:array}", + "\t${0:# body...}" + ] + }, + "foro": { + "prefix": "foro", + "description": "Object Comprehension", + "body": [ + "for ${1:key}, ${2:value} of ${3:Object}", + "\t${0:# body...}" + ] + }, + "swi": { + "prefix": "swi", + "description": "Switch", + "body": [ + "switch ${1:object}", + "\twhen ${2:value}", + "\t\t${3:# body...}", + "\telse", + "\t\t$0" + ] + }, + "try": { + "prefix": "try", + "description": "Try .. Catch", + "body": [ + "try", + "\t$1", + "catch ${2:error}", + "\t$3" + ] + }, + "#": { + "prefix": "#", + "description": "Interpolated Code", + "body": "#{$1\\}$0" + }, + "log": { + "prefix": "log", + "description": "Log", + "body": "console.log ${1:\"${2:msg}\"}" + }, + "kv": { + "prefix": "kv", + "description": "Key:value for object", + "body": "${1:key}:${2:value}" + } +} diff --git a/luasnip_snippets/cpp.json b/luasnip_snippets/cpp.json new file mode 100644 index 0000000..d9b0ba0 --- /dev/null +++ b/luasnip_snippets/cpp.json @@ -0,0 +1,120 @@ +{ + "main": { + "prefix": "main", + "body": [ + "int main(int argc, char *argv[])", + "{", + "\t$0", + "\treturn 0;", + "\\}" + ], + "luasnip": { + "priority": -49 + } + }, + "readfile": { + "prefix": "readfile", + "description": "read file (readF)", + "body": [ + "std::vector<char> v;", + "if (FILE *fp = fopen(${1:\"filename\"}, \"r\"))", + "{", + "\tchar buf[1024];", + "\twhile(size_t len = fread(buf, 1, sizeof(buf), fp))", + "\t\tv.insert(v.end(), buf, buf + len);", + "\tfclose(fp);", + "\\}" + ] + }, + "map": { + "prefix": "map", + "description": "std::map (map)", + "body": "std::map<${1:key}, ${2:value}> map$0;" + }, + "vector": { + "prefix": "vector", + "description": "std::vector (v)", + "body": "std::vector<${1:char}> v$0;" + }, + "tp": { + "prefix": "tp", + "description": "template <typename ..> (template)", + "body": "template <typename ${1:_InputIter}>" + }, + "boost_test": { + "prefix": "boost_test", + "description": "Boost test module", + "body": [ + "#define BOOST_TEST_MODULE ${1:TestModuleName}", + "#include <boost/test/included/unit_test.hpp>", + "", + "BOOST_AUTO_TEST_CASE(${2:TestCaseName})", + "{", + "\t${0:TestDefinition}", + "\\}", + "" + ] + }, + "boost_suite": { + "prefix": "boost_suite", + "description": "Boost test suite module", + "body": [ + "#define BOOST_TEST_MODULE ${1:TestModuleName}", + "#include <boost/test/included/unit_test.hpp>", + "", + "BOOST_AUTO_TEST_SUITE(${2:SuiteName})", + "", + "BOOST_AUTO_TEST_CASE(${3:TestCaseName})", + "{", + "\t${0:TestDefinition}", + "\\}", + "", + "BOOST_AUTO_TEST_SUITE_END()", + "" + ] + }, + "boost_test_fixture": { + "prefix": "boost_test_fixture", + "description": "Boost test module with fixture", + "body": [ + "#define BOOST_TEST_MODULE ${1:TestModuleName}", + "#include <boost/test/included/unit_test.hpp>", + "", + "struct ${2:FixtureName} {", + "\t$2() {\\}", + "\tvirtual ~$2() {\\}", + "\t/* define members here */", + "\\};", + "", + "BOOST_FIXTURE_TEST_CASE(${3:SuiteName}, $2)", + "{", + "\t${0:TestDefinition}", + "\\}", + "" + ] + }, + "boost_suite_fixture": { + "prefix": "boost_suite_fixture", + "description": "Boost test suite with fixture", + "body": [ + "#define BOOST_TEST_MODULE ${1:TestModuleName}", + "#include <boost/test/included/unit_test.hpp>", + "", + "struct ${2:FixtureName} {", + "\t$2() {\\}", + "\tvirtual ~$2() {\\}", + "\t/* define members here */", + "\\};", + "", + "BOOST_FIXTURE_TEST_SUITE(${3:SuiteName}, $2)", + "", + "BOOST_AUTO_TEST_CASE(${4:TestCaseName})", + "{", + "\t${0:TestDefinition}", + "\\}", + "", + "BOOST_AUTO_TEST_SUITE_END()", + "" + ] + } +} diff --git a/luasnip_snippets/crystal.json b/luasnip_snippets/crystal.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/crystal.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/cs.json b/luasnip_snippets/cs.json new file mode 100644 index 0000000..17623a9 --- /dev/null +++ b/luasnip_snippets/cs.json @@ -0,0 +1,206 @@ +{ + "enum": { + "prefix": "enum", + "description": "enumeration", + "body": "enum ${1:MyEnum} { ${2:Item} \\};" + }, + "sim": { + "prefix": "sim", + "description": "static int main", + "body": [ + "static int Main(string[] args)", + "{", + "\t$0", + "\\}" + ] + }, + "svm": { + "prefix": "svm", + "description": "static void main", + "body": [ + "static void Main(string[] args)", + "{", + "\t$0", + "\\}" + ] + }, + "prop": { + "prefix": "prop", + "description": "Simple property declaration", + "body": "public ${1:int} ${2:MyProperty} { get; set; \\}" + }, + "propfull": { + "prefix": "propfull", + "description": "Full property declaration", + "body": [ + "private ${1:int} ${2:_myProperty};", + "", + "public $1 ${3:MyProperty}", + "{", + "\tget { return $2; \\}", + "\tset { $2 = value; \\}", + "\\}" + ] + }, + "propg": { + "prefix": "propg", + "description": "Property with a private setter", + "body": "public ${1:int} ${2:MyProperty} { get; private set; \\}" + }, + "elif": { + "prefix": "elif", + "description": "else if", + "body": [ + "else if ($1)", + "{", + "\t$0", + "\\}" + ] + }, + "elseif": { + "prefix": "elseif", + "description": "else if", + "body": [ + "else if ($1)", + "{", + "\t$0", + "\\}" + ] + }, + "switch": { + "prefix": "switch", + "description": "switch statement", + "body": [ + "switch (${1:statement})", + "{", + "\tcase ${2:value}:", + "\t\tbreak;", + "", + "\tdefault:", + "\t\t$0break;", + "\\}" + ] + }, + "case": { + "prefix": "case", + "description": "case", + "body": [ + "case ${1:value}:", + "\t$2", + "\tbreak;" + ] + }, + "throw": { + "prefix": "throw", + "description": "throw", + "body": "throw new $1Exception(\"$2\");" + }, + "from": { + "prefix": "from", + "description": "LINQ syntax", + "body": [ + "var ${1:seq} =", + "\tfrom ${2:item1} in ${3:items1}", + "\tjoin ${4:item2} in ${5:items2} on $2.${6:prop1} equals $4.${7:prop2}", + "\tselect ${8:$2.prop3}", + "\twhere ${9:clause}" + ] + }, + "da": { + "prefix": "da", + "description": "Debug.Assert", + "body": "Debug.Assert(${1:true});" + }, + "cw": { + "prefix": "cw", + "description": "Console.WriteLine", + "body": "Console.WriteLine(\"$1\");" + }, + "cr": { + "prefix": "cr", + "description": "Console.ReadLine", + "body": "Console.ReadLine();" + }, + "mbox": { + "prefix": "mbox", + "description": "Message box", + "body": "MessageBox.Show(\"${1:message}\");" + }, + "equals": { + "prefix": "equals", + "description": "Equality for a type", + "body": [ + "public override bool Equals(object obj) => Equals(obj as ${1:TYPE});", + "", + "public bool Equals($1 other) // IEquatable<$1>", + "{", + "\tif (object.ReferenceEquals(other, null))", + "\t\treturn false;", + "\tif (object.ReferenceEquals(this, other))", + "\t\treturn true;", + "\tif (this.GetType() != other.GetType())", + "\t\treturn false;", + "\t$0", + "\treturn base.Equals(other);", + "\\}", + "", + "public override int GetHashCode() => base.GetHashCode();", + "", + "public static bool operator ==($1 x, $1 y) =>", + "\t(object.ReferenceEquals(x, null) && object.ReferenceEquals(y, null))", + "\t|| (!object.ReferenceEquals(x, null) && x.Equals(y));", + "", + "public static bool operator !=($1 x, $1 y) => !(x == y);", + "" + ] + }, + "mth": { + "prefix": "mth", + "description": "Method", + "body": [ + "${1:public} ${2:void} ${3:MyMethod}($4)", + "{", + "\t$0", + "\\}" + ] + }, + "mths": { + "prefix": "mths", + "description": "Static method", + "body": [ + "${1:public} static ${2:void} ${3:MyMethod}($4)", + "{", + "\t$0", + "\\}" + ] + }, + "///": { + "prefix": "///", + "description": "XML summary comment", + "body": [ + "/// <summary>", + "/// $0", + "/// </summary>" + ] + }, + "<p": { + "prefix": "<p", + "description": "XML pramameter comment", + "body": "<param name=\"$1\">$2</param>" + }, + "<ex": { + "prefix": "<ex", + "description": "XML exception comment", + "body": "<exception cref=\"${1:System.Exception}\">$2</exception>" + }, + "<r": { + "prefix": "<r", + "description": "XML returns comment", + "body": "<returns>$0</returns>" + }, + "<c": { + "prefix": "<c", + "description": "XML code comment", + "body": "<code>$0</code>" + } +} diff --git a/luasnip_snippets/css.json b/luasnip_snippets/css.json new file mode 100644 index 0000000..427d3af --- /dev/null +++ b/luasnip_snippets/css.json @@ -0,0 +1,271 @@ +{ + "p": { + "prefix": "p", + "description": "padding", + "body": "padding: ${1:0};$0", + "luasnip": { + "priority": -50 + } + }, + "m": { + "prefix": "m", + "description": "margin", + "body": "margin: ${1:0};$0" + }, + "bd": { + "prefix": "bd", + "description": "border", + "body": "border: ${1:0};$0" + }, + "d": { + "prefix": "d", + "description": "display", + "body": "display: ${1:none};$0" + }, + "bg": { + "prefix": "bg", + "description": "background", + "body": "background: ${1:none};$0" + }, + "ff": { + "prefix": "ff", + "description": "font-family", + "body": "font-family: ${1:\"Helvetica Neue\", Helvetica, Arial, sans-serif};$0" + }, + "h": { + "prefix": "h", + "description": "height", + "body": "height: ${1:auto};$0" + }, + "w": { + "prefix": "w", + "description": "width", + "body": "width: ${1:auto};$0" + }, + "pos": { + "prefix": "pos", + "description": "position", + "body": "position: ${1:relative};$0" + }, + "tt": { + "prefix": "tt", + "description": "text-transform", + "body": "text-transform: ${1:none};$0" + }, + "!": { + "prefix": "!", + "description": "!important CSS (!)", + "body": "!important" + }, + "tsh": { + "prefix": "tsh", + "description": "text-shadow: color-hex x y blur (text)", + "body": "text-shadow: ${1:${2:offset-x} ${3:offset-y} ${4:blur} ${5:color}};$0" + }, + "bxsh": { + "prefix": "bxsh", + "description": "box-shadow: color-hex x y blur (text)", + "body": "box-shadow: ${1:${2:offset-x} ${3:offset-y} ${4:blur} ${5:spread} ${6:color} ${7:inset}};$0" + }, + "rgb": { + "prefix": "rgb", + "description": "color rgb", + "body": "rgb(${1:255}, ${2:255}, ${3:255})$0" + }, + "rgba": { + "prefix": "rgba", + "description": "color rgba", + "body": "rgba(${1:255}, ${2:255}, ${3:255}, ${4:0.5})$0" + }, + "hsl": { + "prefix": "hsl", + "description": "color hsl", + "body": "hsl(${1:360}, ${2:100}%, ${3:100}%)$0" + }, + "hsla": { + "prefix": "hsla", + "description": "color hsla", + "body": "hsla(${1:360}, ${2:100}%, ${3:100}%, ${4:0.5})$0" + }, + ":fc": { + "prefix": ":fc", + "body": ":first-child" + }, + ":lc": { + "prefix": ":lc", + "body": ":last-child" + }, + ":nc": { + "prefix": ":nc", + "body": ":nth-child($0)" + }, + ":nlc": { + "prefix": ":nlc", + "body": ":nth-last-child($0)" + }, + ":oc": { + "prefix": ":oc", + "body": ":only-child" + }, + ":a": { + "prefix": ":a", + "body": ":after" + }, + ":b": { + "prefix": ":b", + "body": ":before" + }, + "::a": { + "prefix": "::a", + "body": "::after" + }, + "::b": { + "prefix": "::b", + "body": "::before" + }, + "background": { + "prefix": "background", + "description": "background: color image repeat attachment position (background)", + "body": "background:${6: #${1:DDD}} url($2) ${3:repeat/repeat-x/repeat-y/no-repeat} ${4:scroll/fixed} ${5:top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x-% y-%/x-pos y-pos};$0" + }, + "border": { + "prefix": "border", + "description": "border: size style color (border)", + "body": "border: ${1:1px} ${2:solid} #${3:999};$0" + }, + "clear": { + "prefix": "clear", + "description": "clear: value (clear)", + "body": "clear: ${1:left/right/both/none};$0" + }, + "color": { + "prefix": "color", + "description": "color: color-rgb (color)", + "body": "color: rgb(${1:255},${2:255},${3:255});$0" + }, + "cursor": { + "prefix": "cursor", + "description": "cursor: url (cursor)", + "body": "cursor: url($1);$0" + }, + "direction": { + "prefix": "direction", + "description": "direction: ltr|rtl (direction)", + "body": "direction: ${1:ltr|rtl};$0" + }, + "display": { + "prefix": "display", + "description": "display: table-types (display)", + "body": "display: ${1:table/inline-table/table-row-group/table-header-group/table-footer-group/table-row/table-column-group/table-column/table-cell/table-caption};$0" + }, + "float": { + "prefix": "float", + "description": "float: left:right:none (float)", + "body": "float: ${1:left/right/none};$0" + }, + "font": { + "prefix": "font", + "description": "font: size font (font)", + "body": "font: ${1:75%} ${2:\"Lucida Grande\", \"Trebuchet MS\", Verdana,} ${3:sans-}serif;$0" + }, + "letter": { + "prefix": "letter", + "description": "letter-spacing: length-px (letter)", + "body": "letter-spacing: $1px;$0" + }, + "list": { + "prefix": "list", + "description": "list-style: type position image (list)", + "body": "list-style: ${1:none/disc/circle/square/decimal/zero} ${2:inside/outside} url($3);$0" + }, + "margin": { + "prefix": "margin", + "description": "margin: V H (margin)", + "body": "margin: ${1:20px} ${2:0px};$0" + }, + "marker": { + "prefix": "marker", + "description": "marker-offset: length (marker)", + "body": "marker-offset: ${1:10px};$0" + }, + "overflow": { + "prefix": "overflow", + "description": "overflow: type (overflow)", + "body": "overflow: ${1:visible/hidden/scroll/auto};$0" + }, + "padding": { + "prefix": "padding", + "description": "padding: all (padding)", + "body": "padding: ${1:20px};$0" + }, + "position": { + "prefix": "position", + "description": "position: type (position)", + "body": "position: ${1:static/relative/absolute/fixed};$0" + }, + "{": { + "prefix": "{", + "description": "properties { } ( } )", + "body": [ + "{", + "\t/* $1 */", + "\t$0", + "" + ] + }, + "scrollbar": { + "prefix": "scrollbar", + "description": "scrollbar", + "body": [ + "scrollbar-base-color: ${1:#CCCCCC};${2:", + "scrollbar-arrow-color: ${3:#000000};", + "scrollbar-track-color: ${4:#999999};", + "scrollbar-3dlight-color: ${5:#EEEEEE};", + "scrollbar-highlight-color: ${6:#FFFFFF};", + "scrollbar-face-color: ${7:#CCCCCC};", + "scrollbar-shadow-color: ${9:#999999};", + "scrollbar-darkshadow-color: ${8:#666666};}" + ] + }, + "selection": { + "prefix": "selection", + "description": "selection", + "body": [ + "$1::-moz-selection,", + "$1::selection {", + "\tcolor: ${2:inherit};", + "\tbackground: ${3:inherit};", + "\\}" + ] + }, + "text": { + "prefix": "text", + "description": "text-transform: capitalize:upper:lower (text)", + "body": "text-transform: ${1:capitalize/uppercase/lowercase};$0" + }, + "vertical": { + "prefix": "vertical", + "description": "vertical-align: type (vertical)", + "body": "vertical-align: ${1:baseline/sub/super/top/text-top/middle/bottom/text-bottom/length/%};$0" + }, + "visibility": { + "prefix": "visibility", + "description": "visibility: type (visibility)", + "body": "visibility: ${1:visible/hidden/collapse};$0" + }, + "white": { + "prefix": "white", + "description": "white-space: normal:pre:nowrap (white)", + "body": "white-space: ${1:normal/pre/nowrap};$0" + }, + "word": { + "prefix": "word", + "description": "word-spacing: length (word)", + "body": "word-spacing: ${1:10px};$0" + }, + "z": { + "prefix": "z", + "description": "z-index: index (z)", + "body": "z-index: $1;$0" + } +} diff --git a/luasnip_snippets/cuda.json b/luasnip_snippets/cuda.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/cuda.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/d.json b/luasnip_snippets/d.json new file mode 100644 index 0000000..dbb46aa --- /dev/null +++ b/luasnip_snippets/d.json @@ -0,0 +1,416 @@ +{ + "imp": { + "prefix": "imp", + "description": "import (imp)", + "body": "import ${1:std.stdio};", + "luasnip": { + "priority": -50 + } + }, + "pimp": { + "prefix": "pimp", + "description": "public import (pimp)", + "body": "public import ${1:/*module*/};" + }, + "over": { + "prefix": "over", + "description": "override (over)", + "body": "override ${1:/*function*/}" + }, + "al": { + "prefix": "al", + "description": "alias (al)", + "body": "alias ${1:/*orig*/} ${2:/*alias*/};" + }, + "mixin": { + "prefix": "mixin", + "description": "mixin (mixin)", + "body": "mixin ${1:/*mixed_in*/} ${2:/*name*/};" + }, + "new": { + "prefix": "new", + "description": "new (new)", + "body": "new $1($2);" + }, + "scpn": { + "prefix": "scpn", + "description": "@safe const pure nothrow (scpn)", + "body": "@safe const pure nothrow" + }, + "spn": { + "prefix": "spn", + "description": "@safe pure nothrow (spn)", + "body": "@safe pure nothrow" + }, + "cont": { + "prefix": "cont", + "description": "continue (cont)", + "body": "continue;" + }, + "dis": { + "prefix": "dis", + "description": "@disable (dis)", + "body": "@disable ${1:/*method*/};" + }, + "pub": { + "prefix": "pub", + "description": "public (pub)", + "body": [ + "public:", + "\t${1:/*members*/}" + ] + }, + "priv": { + "prefix": "priv", + "description": "private (priv)", + "body": [ + "private:", + "\t${1:/*members*/}" + ] + }, + "prot": { + "prefix": "prot", + "description": "protected (prot)", + "body": [ + "protected:", + "\t${1:/*members*/}" + ] + }, + "pack": { + "prefix": "pack", + "description": "package (pack)", + "body": [ + "package:", + "\t${1:/*members*/}" + ] + }, + "ret": { + "prefix": "ret", + "description": "return (ret)", + "body": "return ${1:/*value to return*/};" + }, + "auto": { + "prefix": "auto", + "description": "auto (auto)", + "body": "auto ${1:/*variable*/} = ${2:/*value*/};" + }, + "con": { + "prefix": "con", + "description": "const (con)", + "body": "const ${1:/*variable*/} = ${2:/*value*/};" + }, + "siz": { + "prefix": "siz", + "description": "size_t (siz)", + "body": "size_t ${1:/*variable*/} = ${2:/*value*/};" + }, + "sup": { + "prefix": "sup", + "description": "super (sup)", + "body": "super(${1:/*args*/});" + }, + "tup": { + "prefix": "tup", + "description": "tuple (tup)", + "body": "tuple(${1:/*args*/})" + }, + "wr": { + "prefix": "wr", + "description": "writeln (wr)", + "body": "writeln(${1:/*args*/});" + }, + "to": { + "prefix": "to", + "description": "to (to)", + "body": "to!(${1:/*type*/})(${2:/*arg*/})" + }, + "enf": { + "prefix": "enf", + "description": "enforce (enf)", + "body": [ + "enforce(${1:/*condition*/},", + "\tnew $2Exception(${3:/*args*/}));" + ] + }, + "ife": { + "prefix": "ife", + "description": "if .. else (ife)", + "body": [ + "if(${1:/*condition*/})", + "{", + "\t$2", + "\\}", + "else", + "{", + "\t${3:/*else*/}", + "\\}" + ] + }, + "sw": { + "prefix": "sw", + "description": "switch (sw)", + "body": [ + "switch(${1:/*var*/})", + "{", + "\tcase ${2:/*value*/}:", + "\t\t$3", + "\t\tbreak;", + "\tcase ${4:/*value*/}:", + "\t\t$5", + "\t\tbreak;", + "\t${7:/*more cases*/}", + "\tdefault:", + "\t\t${6:assert(false);}", + "\\}" + ] + }, + "fsw": { + "prefix": "fsw", + "description": "final switch (fsw)", + "body": [ + "final switch(${1:/*var*/})", + "{", + "\tcase ${2:/*value*/}:", + "\t\t$3", + "\t\tbreak;", + "\tcase ${4:/*value*/}:", + "\t\t$5", + "\t\tbreak;", + "\t${7:/*more cases*/}", + "\\}" + ] + }, + "case": { + "prefix": "case", + "description": "case (case)", + "body": [ + "case ${1:/*value*/}:", + "\t$2", + "\tbreak;" + ] + }, + "?:": { + "prefix": "?:", + "description": "ternary operator (?:)", + "body": "${1:/*condition*/} ? ${2:/*then*/} : ${3:/*else*/}$4" + }, + "in": { + "prefix": "in", + "description": "in contract (in)", + "body": [ + "in", + "{", + "\tassert(${1:/*condition*/}, \"${2:error message}\");", + "\t$3", + "\\}", + "body" + ] + }, + "out": { + "prefix": "out", + "description": "out contract (out)", + "body": [ + "out${1:(result)}", + "{", + "\tassert(${2:/*condition*/}, \"${3:error message}\");", + "\t$4", + "\\}", + "body" + ] + }, + "inv": { + "prefix": "inv", + "description": "invariant (inv)", + "body": [ + "invariant()", + "{", + "\tassert(${1:/*condition*/}, \"${2:error message}\");", + "\t$3", + "\\}" + ] + }, + "get": { + "prefix": "get", + "description": "getter property (get)", + "body": "@property ${1:/*type*/} ${2:/*member_name*/}() const pure nothrow {return ${3:$2_};\\}" + }, + "set": { + "prefix": "set", + "description": "setter property (set)", + "body": "@property void ${1:/*member_name*/}(${2:/*type*/} rhs) pure nothrow {${3:$1_} = rhs;\\}" + }, + "signal": { + "prefix": "signal", + "description": "signal (signal)", + "body": "mixin Signal!(${1:/*args*/}) ${2:/*name*/};" + }, + "catch": { + "prefix": "catch", + "description": "catch (catch)", + "body": [ + "catch($1Exception e)", + "{", + "\t${2:/*handle exception*/}", + "\\}" + ] + }, + "thr": { + "prefix": "thr", + "description": "throw (thr)", + "body": "throw new $1Exception(\"$2\");" + }, + "exc": { + "prefix": "exc", + "description": "exception declaration (exc)", + "body": [ + "/// ${3:/*documentation*/}", + "class $1Exception : $2Exception", + "{", + "\tpublic this(string msg, string file = __FILE__, int line = __LINE__)", + "\t{", + "\t\tsuper(msg, file, line);", + "\t\\}", + "\\}" + ] + }, + "temp": { + "prefix": "temp", + "description": "template (temp)", + "body": [ + "template ${2:/*name*/}(${1:/*args*/})", + "{", + "\t$3", + "\\}" + ] + }, + "ass": { + "prefix": "ass", + "description": "assert (ass)", + "body": [ + "assert(${1:false}, \"${2:TODO}\");", + "" + ] + }, + "unittest": { + "prefix": "unittest", + "description": "unittest (unittest)", + "body": [ + "unittest", + "{", + "\t$1", + "\\}" + ] + }, + "opDis": { + "prefix": "opDis", + "description": "opDispatch (opDis)", + "body": [ + "${1:/*return type*/} opDispatch(string s)()", + "{", + "\t$2;", + "\\}" + ] + }, + "op=": { + "prefix": "op=", + "description": "opAssign (op=)", + "body": [ + "void opAssign($1 rhs) ${2:@safe pure nothrow}", + "{", + "\t$2", + "\\}" + ] + }, + "opCmp": { + "prefix": "opCmp", + "description": "opCmp (opCmp)", + "body": [ + "int opCmp($1 rhs) @safe const pure nothrow", + "{", + "\t$2", + "\\}" + ] + }, + "opApply": { + "prefix": "opApply", + "description": "opApply (opApply)", + "body": [ + "int opApply(int delegate(ref ${1:/*iterated type/s*/}) dg)", + "{", + "\tint result = 0;", + "\t${2:/*loop*/}", + "\t{", + "\t\tresult = dg(${3:/*arg/s*/});", + "\t\tif(result){break;\\}", + "\t\\}", + "\treturn result;", + "\\}" + ] + }, + "toString": { + "prefix": "toString", + "description": "toString (toString)", + "body": [ + "string toString() @safe const pure nothrow", + "{", + "\t$1", + "\\}" + ] + }, + "todo": { + "prefix": "todo", + "description": "TODO (todo)", + "body": "// TODO: $1" + }, + "doc": { + "prefix": "doc", + "description": "generic ddoc block (doc)", + "body": [ + "/// ${1:description}", + "///", + "/// ${2:details}" + ] + }, + "fdoc": { + "prefix": "fdoc", + "description": "function ddoc block (fdoc)", + "body": [ + "/// ${1:description}", + "///", + "/// ${2:Params: ${3:param} = ${4:param description}", + "///\t\t\t $5}", + "///", + "/// ${6:Returns: ${7:return value}}", + "///", + "/// ${8:Throws: $9Exception $10}" + ] + }, + "Par": { + "prefix": "Par", + "description": "Params (Par)", + "body": [ + "Params: ${1:param} = ${2:param description}", + "///\t\t\t$3" + ] + }, + "Ret": { + "prefix": "Ret", + "description": "Returns (Ret)", + "body": "Returns: ${1:return value/s}" + }, + "Thr": { + "prefix": "Thr", + "description": "Throws (Thr)", + "body": "Throws: $1Exception $2" + }, + "Example": { + "prefix": "Example", + "description": "Examples (Example)", + "body": [ + "Examples:", + "/// --------------------", + "/// ${1:example code}", + "/// --------------------" + ] + } +} diff --git a/luasnip_snippets/django.json b/luasnip_snippets/django.json new file mode 100644 index 0000000..de09161 --- /dev/null +++ b/luasnip_snippets/django.json @@ -0,0 +1,457 @@ +{ + "form": { + "prefix": "form", + "description": "Form", + "body": [ + "class ${1:FORMNAME}(forms.Form):", + "", + "\t${2:# TODO: Define form fields here}" + ], + "luasnip": { + "priority": -50 + } + }, + "modelform": { + "prefix": "modelform", + "description": "ModelForm", + "body": [ + "class ${1:MODELNAME}Form(forms.ModelForm):", + "", + "\tclass Meta:", + "\t\tmodel = $1" + ] + }, + "fbool": { + "prefix": "fbool", + "description": "BooleanField", + "body": "${1:FIELDNAME} = forms.BooleanField($2)" + }, + "fchar": { + "prefix": "fchar", + "description": "CharField", + "body": "${1:FIELDNAME} = forms.CharField($2)" + }, + "fchoice": { + "prefix": "fchoice", + "description": "ChoiceField", + "body": "${1:FIELDNAME} = forms.ChoiceField($2)" + }, + "fcombo": { + "prefix": "fcombo", + "description": "ComboField", + "body": "${1:FIELDNAME} = forms.ComboField($2)" + }, + "fdate": { + "prefix": "fdate", + "description": "DateField", + "body": "${1:FIELDNAME} = forms.DateField($2)" + }, + "fdatetime": { + "prefix": "fdatetime", + "description": "DateTimeField", + "body": "${1:FIELDNAME} = forms.DateTimeField($2)" + }, + "fdecimal": { + "prefix": "fdecimal", + "description": "DecimalField", + "body": "${1:FIELDNAME} = forms.DecimalField($2)" + }, + "fmail": { + "prefix": "fmail", + "description": "EmailField", + "body": "${1:FIELDNAME} = forms.EmailField($2)" + }, + "ffile": { + "prefix": "ffile", + "description": "FileField", + "body": "${1:FIELDNAME} = forms.FileField($2)" + }, + "ffilepath": { + "prefix": "ffilepath", + "description": "FilePathField", + "body": "${1:FIELDNAME} = forms.FilePathField($2)" + }, + "ffloat": { + "prefix": "ffloat", + "description": "FloatField", + "body": "${1:FIELDNAME} = forms.FloatField($2)" + }, + "fip": { + "prefix": "fip", + "description": "IPAddressField", + "body": "${1:FIELDNAME} = forms.IPAddressField($2)" + }, + "fimg": { + "prefix": "fimg", + "description": "ImageField", + "body": "${1:FIELDNAME} = forms.ImageField($2)" + }, + "fint": { + "prefix": "fint", + "description": "IntegerField", + "body": "${1:FIELDNAME} = forms.IntegerField($2)" + }, + "fmochoice": { + "prefix": "fmochoice", + "description": "ModelChoiceField", + "body": "${1:FIELDNAME} = forms.ModelChoiceField($2)" + }, + "fmomuchoice": { + "prefix": "fmomuchoice", + "description": "ModelMultipleChoiceField", + "body": "${1:FIELDNAME} = forms.ModelMultipleChoiceField($2)" + }, + "fmuval": { + "prefix": "fmuval", + "description": "MultiValueField", + "body": "${1:FIELDNAME} = forms.MultiValueField($2)" + }, + "fmuchoice": { + "prefix": "fmuchoice", + "description": "MultipleChoiceField", + "body": "${1:FIELDNAME} = forms.MultipleChoiceField($2)" + }, + "fnullbool": { + "prefix": "fnullbool", + "description": "NullBooleanField", + "body": "${1:FIELDNAME} = forms.NullBooleanField($2)" + }, + "freg": { + "prefix": "freg", + "description": "RegexField", + "body": "${1:FIELDNAME} = forms.RegexField($2)" + }, + "fslug": { + "prefix": "fslug", + "description": "SlugField", + "body": "${1:FIELDNAME} = forms.SlugField($2)" + }, + "fsdatetime": { + "prefix": "fsdatetime", + "description": "SplitDateTimeField", + "body": "${1:FIELDNAME} = forms.SplitDateTimeField($2)" + }, + "ftime": { + "prefix": "ftime", + "description": "TimeField", + "body": "${1:FIELDNAME} = forms.TimeField($2)" + }, + "ftchoice": { + "prefix": "ftchoice", + "description": "TypedChoiceField", + "body": "${1:FIELDNAME} = forms.TypedChoiceField($2)" + }, + "ftmuchoice": { + "prefix": "ftmuchoice", + "description": "TypedMultipleChoiceField", + "body": "${1:FIELDNAME} = forms.TypedMultipleChoiceField($2)" + }, + "furl": { + "prefix": "furl", + "description": "URLField", + "body": "${1:FIELDNAME} = forms.URLField($2)" + }, + "model": { + "prefix": "model", + "description": "Model", + "body": [ + "class ${1:MODELNAME}(models.Model):", + "\t$0", + "\tclass Meta:", + "\t\tverbose_name = \"$1\"", + "\t\tverbose_name_plural = \"$1s\"", + "", + "\tdef __str__(self):", + "\t\treturn super($1, self).__str__()", + "" + ] + }, + "modelfull": { + "prefix": "modelfull", + "description": "Model", + "body": [ + "class ${1:MODELNAME}(models.Model):", + "\t${2:# TODO: Define fields here}", + "", + "\tclass Meta:", + "\t\tverbose_name = \"$1\"", + "\t\tverbose_name_plural = \"$1s\"", + "", + "\tdef __str__(self):", + "\t\treturn super($1, self).__str__()", + "", + "\tdef save(self):", + "\t\treturn super($1, self).save()", + "", + "\tdef get_absolute_url(self):", + "\t\treturn ('')", + "", + "\t${3:# TODO: Define custom methods here}", + "" + ] + }, + "mauto": { + "prefix": "mauto", + "description": "AutoField", + "body": "${1:FIELDNAME} = models.AutoField($2)" + }, + "mbigint": { + "prefix": "mbigint", + "description": "BigIntegerField", + "body": "${1:FIELDNAME} = models.BigIntegerField($2)" + }, + "mbool": { + "prefix": "mbool", + "description": "BooleanField", + "body": "${1:FIELDNAME} = models.BooleanField($2)" + }, + "mchar": { + "prefix": "mchar", + "description": "CharField", + "body": "${1:FIELDNAME} = models.CharField($2, max_length=${3:50})" + }, + "mcoseint": { + "prefix": "mcoseint", + "description": "CommaSeparatedIntegerField", + "body": "${1:FIELDNAME} = models.CommaSeparatedIntegerField($2)" + }, + "mdate": { + "prefix": "mdate", + "description": "DateField", + "body": "${1:FIELDNAME} = models.DateField($2)" + }, + "mdatetime": { + "prefix": "mdatetime", + "description": "DateTimeField", + "body": "${1:FIELDNAME} = models.DateTimeField($2)" + }, + "mdecimal": { + "prefix": "mdecimal", + "description": "DecimalField", + "body": "${1:FIELDNAME} = models.DecimalField(max_digits=${2:10}, decimal_places=${3:2})" + }, + "memail": { + "prefix": "memail", + "description": "EmailField", + "body": "${1:FIELDNAME} = models.EmailField($2)" + }, + "mfile": { + "prefix": "mfile", + "description": "FileField", + "body": "${1:FIELDNAME} = models.FileField($2)" + }, + "mfilepath": { + "prefix": "mfilepath", + "description": "FilePathField", + "body": "${1:FIELDNAME} = models.FilePathField($2)" + }, + "mfloat": { + "prefix": "mfloat", + "description": "FloatField", + "body": "${1:FIELDNAME} = models.FloatField($2)" + }, + "fk": { + "prefix": "fk", + "description": "ForeignKey", + "body": "${1:FIELDNAME} = models.ForeignKey($2)" + }, + "mip": { + "prefix": "mip", + "description": "IPAddressField", + "body": "${1:FIELDNAME} = models.IPAddressField($2)" + }, + "mimg": { + "prefix": "mimg", + "description": "ImageField", + "body": "${1:FIELDNAME} = models.ImageField($2)" + }, + "mint": { + "prefix": "mint", + "description": "IntegerField", + "body": "${1:FIELDNAME} = models.IntegerField($2)" + }, + "m2m": { + "prefix": "m2m", + "description": "ManyToManyField", + "body": "${1:FIELDNAME} = models.ManyToManyField($2)" + }, + "mnullbool": { + "prefix": "mnullbool", + "description": "NullBooleanField", + "body": "${1:FIELDNAME} = models.NullBooleanField($2)" + }, + "o2o": { + "prefix": "o2o", + "description": "OneToOneField", + "body": "${1:FIELDNAME} = models.OneToOneField($2)" + }, + "mphone": { + "prefix": "mphone", + "description": "PhoneNumberField", + "body": "${1:FIELDNAME} = models.PhoneNumberField($2)" + }, + "mposint": { + "prefix": "mposint", + "description": "PositiveIntegerField", + "body": "${1:FIELDNAME} = models.PositiveIntegerField($2)" + }, + "mpossmallint": { + "prefix": "mpossmallint", + "description": "PositiveSmallIntegerField", + "body": "${1:FIELDNAME} = models.PositiveSmallIntegerField($2)" + }, + "mslug": { + "prefix": "mslug", + "description": "SlugField", + "body": "${1:FIELDNAME} = models.SlugField($2)" + }, + "msmallint": { + "prefix": "msmallint", + "description": "SmallIntegerField", + "body": "${1:FIELDNAME} = models.SmallIntegerField($2)" + }, + "mtext": { + "prefix": "mtext", + "description": "TextField", + "body": "${1:FIELDNAME} = models.TextField($2)" + }, + "mtime": { + "prefix": "mtime", + "description": "TimeField", + "body": "${1:FIELDNAME} = models.TimeField($2)" + }, + "murl": { + "prefix": "murl", + "description": "URLField", + "body": "${1:FIELDNAME} = models.URLField($2)" + }, + "musstate": { + "prefix": "musstate", + "description": "USStateField", + "body": "${1:FIELDNAME} = models.USStateField($2)" + }, + "mxml": { + "prefix": "mxml", + "description": "XMLField", + "body": "${1:FIELDNAME} = models.XMLField($2)" + }, + "adminview": { + "prefix": "adminview", + "description": "Model Admin View", + "body": [ + "class $1Admin(admin.ModelAdmin):", + "\t'''", + "\t\tAdmin View for $1", + "\t'''", + "\tlist_display = ('$2',)", + "\tlist_filter = ('$3',)", + "\tinlines = [", + "\t\t$4Inline,", + "\t]", + "\traw_id_fields = ('$5',)", + "\treadonly_fields = ('$6',)", + "\tsearch_fields = ['$7']", + "admin.site.register($1, $1Admin)" + ] + }, + "createview": { + "prefix": "createview", + "description": "Generic Create View", + "body": [ + "class ${1:MODEL_NAME}CreateView(CreateView):", + "\tmodel = $1", + "\ttemplate_name = \"${2:TEMPLATE_NAME}\"" + ] + }, + "deleteview": { + "prefix": "deleteview", + "description": "Generic Delete View", + "body": [ + "class ${1:MODEL_NAME}DeleteView(DeleteView):", + "\tmodel = $1", + "\ttemplate_name = \"${2:TEMPLATE_NAME}\"" + ] + }, + "detailview": { + "prefix": "detailview", + "description": "Generic Detail View", + "body": [ + "class ${1:MODEL_NAME}DetailView(DetailView):", + "\tmodel = $1", + "\ttemplate_name = \"${2:TEMPLATE_NAME}\"" + ] + }, + "listview": { + "prefix": "listview", + "description": "Generic List View", + "body": [ + "class ${1:MODEL_NAME}ListView(ListView):", + "\tmodel = $1", + "\ttemplate_name = \"${2:TEMPLATE_NAME}\"" + ] + }, + "stackedinline": { + "prefix": "stackedinline", + "description": "Stacked Inline", + "body": [ + "class $1Inline(admin.StackedInline):", + "\t'''", + "\tStacked Inline View for $1", + "\t'''", + "\tmodel = ${2:$1}", + "\tmin_num = ${3:3}", + "\tmax_num = ${4:20}", + "\textra = ${5:1}", + "\traw_id_fields = ($6,)" + ] + }, + "tabularinline": { + "prefix": "tabularinline", + "description": "Tabular Inline", + "body": [ + "class $1Inline(admin.TabularInline):", + "\t'''", + "\tTabular Inline View for $1", + "\t'''", + "\tmodel = ${2:$1}", + "\tmin_num = ${3:3}", + "\tmax_num = ${4:20}", + "\textra = ${5:1}", + "\traw_id_fields = ($6,)" + ] + }, + "templateview": { + "prefix": "templateview", + "description": "Generic Template View", + "body": [ + "class ${1:CLASS_NAME}(TemplateView):", + "\ttemplate_name = \"${2:TEMPLATE_NAME}\"" + ] + }, + "updateview": { + "prefix": "updateview", + "description": "Generic Update View", + "body": [ + "class ${1:MODEL_NAME}UpdateView(UpdateView):", + "\tmodel = $1", + "\ttemplate_name = \"${2:TEMPLATE_NAME}\"" + ] + }, + "dispatch": { + "prefix": "dispatch", + "description": "Dispatch View method", + "body": [ + "def dispatch(self, request, *args, **kwargs):", + "\treturn super(${1:CLASS_NAME}, self).dispatch(request, *args, **kwargs)" + ] + }, + "context": { + "prefix": "context", + "description": "get_context_data view method", + "body": [ + "def get_context_data(self, **kwargs):", + "\tkwargs['extra_context'] = ${1:'New Value'}", + "\treturn super(${2:CLASS_NAME}, self).get_context_data(**kwargs)" + ] + } +} diff --git a/luasnip_snippets/eelixir.json b/luasnip_snippets/eelixir.json new file mode 100644 index 0000000..8ca13ed --- /dev/null +++ b/luasnip_snippets/eelixir.json @@ -0,0 +1,53 @@ +{ + "%": { + "prefix": "%", + "description": "<% %>", + "body": "<% $0 %>", + "luasnip": { + "priority": -50 + } + }, + "=": { + "prefix": "=", + "description": "<%= %>", + "body": "<%= $0 %>" + }, + "end": { + "prefix": "end", + "description": "<% end %>", + "body": "<% end %>" + }, + "for": { + "prefix": "for", + "body": [ + "<%= for ${1:item} <- ${2:$1s} ${3:@conn} do %>", + "\t$0", + "<% end %>" + ] + }, + "ft": { + "prefix": "ft", + "description": "form_tag", + "body": [ + "<%= form_tag(${1:\"${2:/users}\"}, method: ${3::post}) %>", + "\t$0", + "</form>" + ] + }, + "lin": { + "prefix": "lin", + "description": "link", + "body": "<%= link ${1:\"${2:Submit}\"}, to: ${3:\"${4:/users}\"}, method: ${5::delete} %>" + }, + "ff": { + "prefix": "ff", + "description": "form_for", + "body": [ + "<%= form_for @changeset, ${1:\"${2:/users}\"}, fn f -> %>", + "\t\t$0", + "", + "\t<%= submit \"Submit\" %>", + "<% end %>" + ] + } +} diff --git a/luasnip_snippets/ejs.json b/luasnip_snippets/ejs.json new file mode 100644 index 0000000..166f8a1 --- /dev/null +++ b/luasnip_snippets/ejs.json @@ -0,0 +1,20 @@ +{ + "for": { + "prefix": "for", + "description": "ejs for loop", + "body": [ + "<% for (let ${1:i = 0}; ${2:i<arr.length}; ${3:i++}) { %>", + "\t${0:body}", + "<% \\} %>" + ] + }, + "forE": { + "prefix": "forE", + "description": "ejs for Each loop", + "body": [ + "<% ${1:array}.forEach((${2:single var}) => { %>", + "\t${0:body}", + "<% \\}) %>" + ] + } +} diff --git a/luasnip_snippets/elm.json b/luasnip_snippets/elm.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/elm.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/erlang.json b/luasnip_snippets/erlang.json new file mode 100644 index 0000000..e7e336c --- /dev/null +++ b/luasnip_snippets/erlang.json @@ -0,0 +1,23 @@ +{ + "pat": { + "prefix": "pat", + "description": "Case:Receive:Try Clause", + "body": [ + "${1:pattern}${2: when ${3:guard}} ->", + "\t${4:body}" + ], + "luasnip": { + "priority": -50 + } + }, + "||": { + "prefix": "||", + "description": "List Comprehension", + "body": "[${1:X} || ${2:X} <- ${3:List}${4:, gen}]" + }, + "gen": { + "prefix": "gen", + "description": "Generator Expression", + "body": "${1:X} <- ${2:List}${3:, gen}" + } +} diff --git a/luasnip_snippets/eruby.json b/luasnip_snippets/eruby.json new file mode 100644 index 0000000..2c787d9 --- /dev/null +++ b/luasnip_snippets/eruby.json @@ -0,0 +1,75 @@ +{ + "layout": { + "prefix": "layout", + "description": "layout", + "body": "layout \"${1:template_name}\"${2:${3:, :only => ${4:[:${5:action}, :${6:action}]}}${7:, :except => ${8:[:${9:action}, :${10:action}]}}}" + }, + "hide": { + "prefix": "hide", + "description": "page.hide (*ids)", + "body": "page.hide ${1:\"${2:id(s)}\"}" + }, + "ins": { + "prefix": "ins", + "description": "page.insert_html (position, id, partial)", + "body": "page.insert_html :${1:top}, ${2:\"${3:id}\"}, :${4:partial => \"${5:template}\"}" + }, + "rep": { + "prefix": "rep", + "description": "page.replace (id, partial)", + "body": "page.replace ${1:\"${2:id}\"}, :${3:partial => \"${4:template}\"}" + }, + "reph": { + "prefix": "reph", + "description": "page.replace_html (id, partial)", + "body": "page.replace_html ${1:\"${2:id}\"}, :${3:partial => \"${4:template}\"}" + }, + "show": { + "prefix": "show", + "description": "page.show (*ids)", + "body": "page.show ${1:\"${2:id(s)}\"}" + }, + "tog": { + "prefix": "tog", + "description": "page.toggle (*ids)", + "body": "page.toggle ${1:\"${2:id(s)}\"}" + }, + "vis": { + "prefix": "vis", + "description": "page.visual_effect (effect, id)", + "body": "page.visual_effect :${1:toggle_slide}, ${2:\"${3:DOM ID}\"}" + }, + "rp": { + "prefix": "rp", + "description": "render (partial) (rp)", + "body": "render :partial => \"${1:item}\"" + }, + "rpc": { + "prefix": "rpc", + "description": "render (partial,collection) (rpc)", + "body": "render :partial => \"${1:item}\", :collection => ${2:@$1s}" + }, + "rpl": { + "prefix": "rpl", + "description": "render (partial,locals) (rpl)", + "body": "render :partial => \"${1:item}\", :locals => { :${2:$1} => ${3:@$1}$0 \\}" + }, + "rpo": { + "prefix": "rpo", + "description": "render (partial,object) (rpo)", + "body": "render :partial => \"${1:item}\", :object => ${2:@$1}" + }, + "rps": { + "prefix": "rps", + "description": "render (partial,status) (rps)", + "body": "render :partial => \"${1:item}\", :status => ${2:500}" + }, + "else": { + "prefix": "else", + "description": "else (ERB)", + "body": [ + "<% else %>", + "\t$0" + ] + } +} diff --git a/luasnip_snippets/gitcommit.json b/luasnip_snippets/gitcommit.json new file mode 100644 index 0000000..ffe8bfd --- /dev/null +++ b/luasnip_snippets/gitcommit.json @@ -0,0 +1,22 @@ +{ + "sign": { + "prefix": "sign", + "description": "Signature", + "body": [ + "-------------------------------------------------------------------------------", + "${1:Company Name}", + "", + "${2:Author Name}", + "", + "${3:Streetname 21}", + "${4:City and Area}", + "", + "${5:Tel: \t\t\t\t\t\t+44 (0)987 / 888 8888}", + "${6:Fax: \t\t\t\t\t\t+44 (0)987 / 888 8882}", + "${7:Mail: \t\t\t\t\tEmail}", + "${8:Web: \t\t\t\t\t\thttps://}", + "-------------------------------------------------------------------------------", + "$0" + ] + } +} diff --git a/luasnip_snippets/go.json b/luasnip_snippets/go.json new file mode 100644 index 0000000..1a52ce5 --- /dev/null +++ b/luasnip_snippets/go.json @@ -0,0 +1,26 @@ +{ + "map": { + "prefix": "map", + "description": "Map type", + "body": "map[${1:keytype}]${2:valtype}" + }, + ":": { + "prefix": ":", + "description": "Variable declaration :=", + "body": "${1:name} := ${0:value}" + }, + "json": { + "prefix": "json", + "description": "JSON field", + "body": "`json:\"${1:displayName}\"`" + }, + "err": { + "prefix": "err", + "description": "Basic error handling", + "body": [ + "if err != nil {", + "\tlog.${1:Fatal}(err)", + "\\}" + ] + } +} diff --git a/luasnip_snippets/haskell.json b/luasnip_snippets/haskell.json new file mode 100644 index 0000000..f9cfd48 --- /dev/null +++ b/luasnip_snippets/haskell.json @@ -0,0 +1,15 @@ +{ + "imp": { + "prefix": "imp", + "description": "Simple import", + "body": "import ${1:${2:Data}.${0:Text}}", + "luasnip": { + "priority": -50 + } + }, + "imp2": { + "prefix": "imp2", + "description": "Selective import", + "body": "import ${1:${2:Data}.${3:Text}} ($4)$0" + } +} diff --git a/luasnip_snippets/help.json b/luasnip_snippets/help.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/help.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/html.json b/luasnip_snippets/html.json new file mode 100644 index 0000000..b8d3de7 --- /dev/null +++ b/luasnip_snippets/html.json @@ -0,0 +1,426 @@ +{ + "doctype": { + "prefix": "doctype", + "description": "HTML - 5.0 (doctype)", + "body": [ + "<!DOCTYPE html>", + "" + ], + "luasnip": { + "priority": -50 + } + }, + "down": { + "prefix": "down", + "description": "Down (down)", + "body": "↓" + }, + "enter": { + "prefix": "enter", + "description": "Enter (enter)", + "body": "⌅" + }, + "escape": { + "prefix": "escape", + "description": "Escape (escape)", + "body": "⎋" + }, + "left": { + "prefix": "left", + "description": "Left (left)", + "body": "←" + }, + "return": { + "prefix": "return", + "description": "Return (return)", + "body": "↩" + }, + "right": { + "prefix": "right", + "description": "Right (right)", + "body": "→" + }, + "shift": { + "prefix": "shift", + "description": "Shift (shift)", + "body": "⇧" + }, + "tab": { + "prefix": "tab", + "description": "Tab (tab)", + "body": "⇥" + }, + "up": { + "prefix": "up", + "description": "Up (up)", + "body": "↑" + }, + "a": { + "prefix": "a", + "description": "Link", + "body": "<a href=\"${1:http://www.${2:url.com}}\"${3: target=\"_blank\"}>${4:Anchor Text}</a>" + }, + "abbr": { + "prefix": "abbr", + "description": "<abbr>", + "body": "<abbr title=\"$2\">$1</abbr>" + }, + "access": { + "prefix": "access", + "description": "accesskey global attribute", + "body": "accesskey=\"$1\"" + }, + "address": { + "prefix": "address", + "description": "<address>", + "body": "<address>$1</address>" + }, + "article": { + "prefix": "article", + "description": "<article>", + "body": [ + "<article>", + "\t${1:article content}", + "</article>" + ] + }, + "aside": { + "prefix": "aside", + "description": "<aside>", + "body": [ + "<aside>", + "\t${1:aside content}", + "</aside>" + ] + }, + "b": { + "prefix": "b", + "description": "<b>", + "body": "<b>$1</b>" + }, + "blockquote": { + "prefix": "blockquote", + "description": "<blockquote>", + "body": "<blockquote>$1</blockquote>" + }, + "br": { + "prefix": "br", + "description": "<br>", + "body": "<br>$1</br>" + }, + "button": { + "prefix": "button", + "description": "<button>", + "body": "<button>$1</button>" + }, + "caption": { + "prefix": "caption", + "description": "<caption>", + "body": "<caption>$1</caption>" + }, + "cite": { + "prefix": "cite", + "description": "<cite>", + "body": "<cite>$1</cite>" + }, + "class": { + "prefix": "class", + "description": "class global attribute", + "body": "class=\"$1\"" + }, + "code": { + "prefix": "code", + "description": "<code>", + "body": "<code>$1</code>" + }, + "data": { + "prefix": "data", + "description": "<data>", + "body": "<data value=\"$2\">$1</data>" + }, + "datalist": { + "prefix": "datalist", + "description": "<datalist>", + "body": [ + "<datalist id=\"$1\" name=\"$2\">", + "\topt$3", + "</datalist>" + ] + }, + "dd": { + "prefix": "dd", + "description": "<dd>", + "body": "<dd>$1</dd>" + }, + "dfn": { + "prefix": "dfn", + "description": "<dfn>", + "body": "<dfn>$1</dfn>" + }, + "dl": { + "prefix": "dl", + "description": "<dl>", + "body": [ + "<dl>", + "\t${1:Definition list}", + "</dl>" + ] + }, + "dt": { + "prefix": "dt", + "description": "<dt>", + "body": "<dt>$1</dt>" + }, + "em": { + "prefix": "em", + "description": "<em>", + "body": "<em>$1</em>" + }, + "fig": { + "prefix": "fig", + "description": "<figure>", + "body": [ + "<figure>", + "$1", + "<figcaption>$2</figcaption>", + "</figure>" + ] + }, + "figcaption": { + "prefix": "figcaption", + "description": "<figcaption>", + "body": "<figcaption>$1</figcaption>" + }, + "footer": { + "prefix": "footer", + "description": "<footer>", + "body": [ + "<footer>", + "\t${1:footer content}", + "</footer>" + ] + }, + "header": { + "prefix": "header", + "description": "<header>", + "body": [ + "<header>", + "\t${1:header content}", + "</header>" + ] + }, + "hr": { + "prefix": "hr", + "description": "<hr>", + "body": "<hr>" + }, + "i": { + "prefix": "i", + "description": "<i>", + "body": "<i>$1</i>" + }, + "id": { + "prefix": "id", + "description": "id global attribute", + "body": "id=\"$1\"" + }, + "img": { + "prefix": "img", + "description": "<img>", + "body": "<img src=\"$1\" alt=\"$2\">" + }, + "kbd": { + "prefix": "kbd", + "description": "<kbd>", + "body": "<kbd>$1</kbd>" + }, + "label": { + "prefix": "label", + "description": "<label>", + "body": "<label>$1</label>" + }, + "legend": { + "prefix": "legend", + "description": "<legend>", + "body": "<legend>$1</legend>" + }, + "mailto": { + "prefix": "mailto", + "description": "HTML <a mailto: >", + "body": "<a href=\"mailto:${1:joe@example.com}?subject=${2:feedback}\">${3:email me}</a>" + }, + "tel": { + "prefix": "tel", + "description": "HTML <a tel: >", + "body": "<a href=\"tel:+${1:XX1234567890}\">${2:call me}</a>" + }, + "main": { + "prefix": "main", + "description": "<main>", + "body": [ + "<main>", + "\t${1:main content}", + "</main>" + ] + }, + "mark": { + "prefix": "mark", + "description": "<mark>", + "body": "<mark>$1</mark>" + }, + "meter": { + "prefix": "meter", + "description": "<meter>", + "body": "<meter>$1</meter>" + }, + "nav": { + "prefix": "nav", + "description": "<nav>", + "body": [ + "<nav>", + "\t${1:navigation links}", + "</nav>" + ] + }, + "noscript": { + "prefix": "noscript", + "description": "<noscript>", + "body": "<noscript>$1</noscript>" + }, + "ol": { + "prefix": "ol", + "description": "<ol>", + "body": [ + "<ol>", + "\t<li>$1</li>", + "</ol>" + ] + }, + "optgroup": { + "prefix": "optgroup", + "description": "<optgroup>", + "body": [ + "<optgroup label=\"$1\">", + "\topt$2", + "</optgroup>" + ] + }, + "output": { + "prefix": "output", + "description": "<output>", + "body": "<output for=\"$1\" name=\"$2\">$3</output>" + }, + "option": { + "prefix": "option", + "description": "Option", + "body": "<option${1: value=\"${2:option}\"}>${3:$2}</option>" + }, + "picture": { + "prefix": "picture", + "description": "<picture>", + "body": [ + "<picture>", + "\t${1:image sources}", + "</picture>" + ] + }, + "pre": { + "prefix": "pre", + "description": "<pre>", + "body": "<pre>$1</pre>" + }, + "progress": { + "prefix": "progress", + "description": "<progress>", + "body": "<progress>$1</progress>" + }, + "q": { + "prefix": "q", + "description": "<q>", + "body": "<q>$1</q>" + }, + "s": { + "prefix": "s", + "description": "<s>", + "body": "<s>$1</s>" + }, + "samp": { + "prefix": "samp", + "description": "<samp>", + "body": "<samp>$1</samp>" + }, + "scriptsrc": { + "prefix": "scriptsrc", + "description": "HTML <script src...>", + "body": "<script src=\"$1\" charset=\"${3:utf-8}\"></script>" + }, + "small": { + "prefix": "small", + "description": "<small>", + "body": "<small>$1</small>" + }, + "strong": { + "prefix": "strong", + "description": "<strong>", + "body": "<strong>$1</strong>" + }, + "sub": { + "prefix": "sub", + "description": "<sub>", + "body": "<sub>$1</sub>" + }, + "sup": { + "prefix": "sup", + "description": "<sup>", + "body": "<sup>$1</sup>" + }, + "tbody": { + "prefix": "tbody", + "description": "<tbody>", + "body": "<tbody>$1</tbody>" + }, + "template": { + "prefix": "template", + "description": "<template>", + "body": [ + "<template id=\"$1\">", + "$2", + "</template>" + ] + }, + "textarea": { + "prefix": "textarea", + "description": "HTML <textarea>", + "body": "<textarea name=\"${1:Name}\" rows=\"${2:8}\" cols=\"${3:40}\">$0</textarea>" + }, + "tfoot": { + "prefix": "tfoot", + "description": "<tfoot>", + "body": "<tfoot>$1</tfoot>" + }, + "thead": { + "prefix": "thead", + "description": "<thead>", + "body": "<thead>$1</thead>" + }, + "time": { + "prefix": "time", + "description": "<time>", + "body": "<time datetime=\"$2\">$1</time>" + }, + "var": { + "prefix": "var", + "description": "<var>", + "body": "<var>$1</var>" + }, + "viewport": { + "prefix": "viewport", + "description": "Responsive viewport meta", + "body": "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" + }, + "wbr": { + "prefix": "wbr", + "description": "<wbr>", + "body": "<wbr>$1</wbr>" + } +} diff --git a/luasnip_snippets/html_minimal.json b/luasnip_snippets/html_minimal.json new file mode 100644 index 0000000..aacf551 --- /dev/null +++ b/luasnip_snippets/html_minimal.json @@ -0,0 +1,36 @@ +{ + "id": { + "prefix": "id", + "body": "id=\"$1\"$2", + "luasnip": { + "priority": -49 + } + }, + "idn": { + "prefix": "idn", + "body": "id=\"$1\" name=\"${2:$1}\"" + }, + "label_and_input": { + "prefix": "label_and_input", + "body": [ + "<label for=\"${2:$1}\">$1</label>", + "<input type=\"${3:text}\" name=\"${4:$2}\"${5: id=\"${6:$2}\"} value=\"$7\" />$8" + ] + }, + "input": { + "prefix": "input", + "body": "<input type=\"${1:text}\" value=\"$2\" name=\"$3\"${4: id=\"${5:$3}\"}/>$7" + }, + "submit": { + "prefix": "submit", + "body": "<input type=\"submit\" value=\"$2\" $3/>$7" + }, + "textarea": { + "prefix": "textarea", + "body": "<textarea name=\"$2\"${3: id=\"$4\"}>$5</textarea>" + }, + "img": { + "prefix": "img", + "body": "<img src=\"$1\"${2: alt=\"$3\"}/>" + } +} diff --git a/luasnip_snippets/htmldjango.json b/luasnip_snippets/htmldjango.json new file mode 100644 index 0000000..aa25f02 --- /dev/null +++ b/luasnip_snippets/htmldjango.json @@ -0,0 +1,345 @@ +{ + "%": { + "prefix": "%", + "description": "", + "body": "{% $1 %\\}$2", + "luasnip": { + "priority": -50 + } + }, + "%%": { + "prefix": "%%", + "description": "", + "body": [ + "{% ${1:tag_name} %\\}", + "\t$2", + "{% end$1 %\\}" + ] + }, + "{": { + "prefix": "{", + "description": "", + "body": "{{ $1 \\}\\}$2" + }, + "autoescape": { + "prefix": "autoescape", + "description": "", + "body": [ + "{% autoescape ${1:off} %\\}", + "\t$2", + "{% endautoescape %\\}" + ] + }, + "block": { + "prefix": "block", + "description": "", + "body": [ + "{% block $1 %\\}", + "\t$2", + "{% endblock $1 %\\}" + ] + }, + "#": { + "prefix": "#", + "description": "", + "body": "{# ${1:comment} #\\}" + }, + "comment": { + "prefix": "comment", + "description": "", + "body": [ + "{% comment %\\}", + "\t$1", + "{% endcomment %\\}" + ] + }, + "cycle": { + "prefix": "cycle", + "description": "", + "body": "{% cycle ${1:val1} ${2:val2} ${3:as $4} %\\}" + }, + "debug": { + "prefix": "debug", + "description": "", + "body": "{% debug %\\}" + }, + "extends": { + "prefix": "extends", + "description": "", + "body": "{% extends \"${1:base.html}\" %\\}" + }, + "filter": { + "prefix": "filter", + "description": "", + "body": [ + "{% filter $1 %\\}", + "\t$2", + "{% endfilter %\\}" + ] + }, + "firstof": { + "prefix": "firstof", + "description": "", + "body": "{% firstof $1 %\\}" + }, + "for": { + "prefix": "for", + "description": "", + "body": [ + "{% for $1 in $2 %\\}", + "\t$3", + "{% endfor %\\}" + ] + }, + "empty": { + "prefix": "empty", + "description": "", + "body": [ + "{% empty %\\}", + "\t$1" + ] + }, + "if": { + "prefix": "if", + "description": "", + "body": [ + "{% if $1 %\\}", + "\t$2", + "{% endif %\\}" + ] + }, + "iif": { + "prefix": "iif", + "description": "", + "body": "{% if $1 %\\}$2{% endif %\\}" + }, + "ielse": { + "prefix": "ielse", + "description": "", + "body": "{% else %\\}$1" + }, + "else": { + "prefix": "else", + "description": "", + "body": [ + "{% else %\\}", + "\t$1" + ] + }, + "ielif": { + "prefix": "ielif", + "description": "", + "body": "{% elif %\\}$1" + }, + "elif": { + "prefix": "elif", + "description": "", + "body": [ + "{% elif %\\}", + "\t$1" + ] + }, + "ifchanged": { + "prefix": "ifchanged", + "description": "", + "body": "{% ifchanged %\\}$1{% endifchanged %\\}" + }, + "ifequal": { + "prefix": "ifequal", + "description": "", + "body": [ + "{% ifequal $1 $2 %\\}", + "\t$3", + "{% endifequal %\\}" + ] + }, + "ifnotequal": { + "prefix": "ifnotequal", + "description": "", + "body": [ + "{% ifnotequal $1 $2 %\\}", + "\t$3", + "{% endifnotequal %\\}" + ] + }, + "include": { + "prefix": "include", + "description": "", + "body": "{% include \"$1\" %\\}" + }, + "load": { + "prefix": "load", + "description": "", + "body": "{% load $1 %\\}" + }, + "now": { + "prefix": "now", + "description": "", + "body": "{% now \"${1:jS F Y H:i}\" %\\}" + }, + "regroup": { + "prefix": "regroup", + "description": "", + "body": "{% regroup $1 by $2 as $3 %\\}" + }, + "spaceless": { + "prefix": "spaceless", + "description": "", + "body": "{% spaceless %\\}$1{% endspaceless %\\}" + }, + "ssi": { + "prefix": "ssi", + "description": "", + "body": "{% ssi $1 %\\}" + }, + "trans": { + "prefix": "trans", + "description": "", + "body": "{% trans \"${1:string}\" %\\}" + }, + "url": { + "prefix": "url", + "description": "", + "body": "{% url $1 as $2 %\\}" + }, + "widthratio": { + "prefix": "widthratio", + "description": "", + "body": "{% widthratio ${1:this_value} ${2:max_value} ${3:100} %\\}" + }, + "super": { + "prefix": "super", + "description": "", + "body": "{{ block.super \\}\\}" + }, + "staticu": { + "prefix": "staticu", + "description": "", + "body": "{{ STATIC_URL \\}\\}" + }, + "mediau": { + "prefix": "mediau", + "description": "", + "body": "{{ MEDIA_URL \\}\\}" + }, + "csrf": { + "prefix": "csrf", + "description": "", + "body": "{% csrf_token %\\}" + }, + "lorem": { + "prefix": "lorem", + "description": "", + "body": "{% lorem $1 %\\}" + }, + "add": { + "prefix": "add", + "description": "", + "body": "add:\"$1\"" + }, + "center": { + "prefix": "center", + "description": "", + "body": "center:\"$1\"" + }, + "cut": { + "prefix": "cut", + "description": "", + "body": "cut:\"$1\"" + }, + "date": { + "prefix": "date", + "description": "", + "body": "date:\"$1\"" + }, + "default": { + "prefix": "default", + "description": "", + "body": "default:\"$1\"" + }, + "defaultifnone": { + "prefix": "defaultifnone", + "description": "", + "body": "default_if_none:\"$1\"" + }, + "dictsort": { + "prefix": "dictsort", + "description": "", + "body": "dictsort:\"$1\"" + }, + "dictsortrev": { + "prefix": "dictsortrev", + "description": "", + "body": "dictsortreversed:\"$1\"" + }, + "divisibleby": { + "prefix": "divisibleby", + "description": "", + "body": "divisibleby:\"$1\"" + }, + "floatformat": { + "prefix": "floatformat", + "description": "", + "body": "floatformat:\"$1\"" + }, + "getdigit": { + "prefix": "getdigit", + "description": "", + "body": "get_digit:\"$1\"" + }, + "join": { + "prefix": "join", + "description": "", + "body": "join:\"$1\"" + }, + "lengthis": { + "prefix": "lengthis", + "description": "", + "body": "length_is:\"$1\"" + }, + "pluralize": { + "prefix": "pluralize", + "description": "", + "body": "pluralize:\"$1\"" + }, + "removetags": { + "prefix": "removetags", + "description": "", + "body": "removetags:\"$1\"" + }, + "slice": { + "prefix": "slice", + "description": "", + "body": "slice:\"$1\"" + }, + "stringformat": { + "prefix": "stringformat", + "description": "", + "body": "stringformat:\"$1\"" + }, + "time": { + "prefix": "time", + "description": "", + "body": "time:\"$1\"" + }, + "truncatewords": { + "prefix": "truncatewords", + "description": "", + "body": "truncatewords:$1" + }, + "truncatewordshtml": { + "prefix": "truncatewordshtml", + "description": "", + "body": "truncatewords_html:$1" + }, + "urlizetrunc": { + "prefix": "urlizetrunc", + "description": "", + "body": "urlizetrunc:$1" + }, + "wordwrap": { + "prefix": "wordwrap", + "description": "", + "body": "wordwrap:$1" + } +} diff --git a/luasnip_snippets/htmljinja.json b/luasnip_snippets/htmljinja.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/htmljinja.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/java.json b/luasnip_snippets/java.json new file mode 100644 index 0000000..1d0dd3b --- /dev/null +++ b/luasnip_snippets/java.json @@ -0,0 +1,202 @@ +{ + "sleep": { + "prefix": "sleep", + "description": "try sleep catch", + "body": [ + "try {", + "\tThread.sleep(${1:1000});", + "\\} catch (InterruptedException e){", + "\te.printStackTrace();", + "\\}" + ], + "luasnip": { + "priority": -50 + } + }, + "ab": { + "prefix": "ab", + "description": "abstract", + "body": "abstract $0" + }, + "at": { + "prefix": "at", + "description": "assert true", + "body": "assertTrue(${1:actual});" + }, + "af": { + "prefix": "af", + "description": "assert false", + "body": "assertFalse(${1:actual});" + }, + "ae": { + "prefix": "ae", + "description": "assert equals", + "body": "assertEquals(${1:expected}, ${2:actual});" + }, + "br": { + "prefix": "br", + "description": "break", + "body": [ + "break;", + "" + ] + }, + "cs": { + "prefix": "cs", + "description": "case", + "body": [ + "case $1:", + "\t$2", + "$0" + ] + }, + "cos": { + "prefix": "cos", + "description": "constant string", + "body": "public static final String ${1:var} = \"$2\";$0" + }, + "co": { + "prefix": "co", + "description": "constant", + "body": "public static final ${1:String} ${2:var} = $3;$0" + }, + "de": { + "prefix": "de", + "description": "default", + "body": [ + "default:", + "\t$0" + ] + }, + "fi": { + "prefix": "fi", + "description": "final", + "body": "final $0" + }, + "imt": { + "prefix": "imt", + "description": "import junit_framework_TestCase;", + "body": [ + "import junit.framework.TestCase;", + "$0" + ] + }, + "im": { + "prefix": "im", + "description": "import", + "body": "import ${1:java}.${2:util}.$0;" + }, + "cc": { + "prefix": "cc", + "description": "constructor call or setter body", + "body": "this.${1:var} = $1;" + }, + "list": { + "prefix": "list", + "description": "Collections List", + "body": "List<${1:String}> ${2:list} = new ${3:Array}List<$1>();" + }, + "map": { + "prefix": "map", + "description": "Collections Map", + "body": "Map<${1:String}, ${2:String}> ${3:map} = new ${4:Hash}Map<$1, $2>();" + }, + "set": { + "prefix": "set", + "description": "Collections Set", + "body": "Set<${1:String}> ${2:set} = new ${3:Hash}Set<$1>();" + }, + "j.b": { + "prefix": "j.b", + "description": "java_beans_", + "body": "java.beans." + }, + "j.i": { + "prefix": "j.i", + "description": "java_io", + "body": "java.io." + }, + "j.m": { + "prefix": "j.m", + "description": "java_math", + "body": "java.math." + }, + "j.n": { + "prefix": "j.n", + "description": "java_net_", + "body": "java.net." + }, + "j.u": { + "prefix": "j.u", + "description": "java_util_", + "body": "java.util." + }, + "mt": { + "prefix": "mt", + "description": "method throws", + "body": [ + "${1:private} ${2:void} ${3:method}($4) ${5:throws $6 }{", + "\t$0", + "\\}" + ] + }, + "m": { + "prefix": "m", + "description": "method", + "body": [ + "${1:private} ${2:void} ${3:method}($4) {", + "\t$0", + "\\}" + ] + }, + "pa": { + "prefix": "pa", + "description": "package", + "body": "package $0" + }, + "p": { + "prefix": "p", + "description": "print", + "body": "System.out.print($1);$0" + }, + "pl": { + "prefix": "pl", + "description": "println", + "body": "System.out.println($1);$0" + }, + "pr": { + "prefix": "pr", + "description": "private", + "body": "private $0" + }, + "po": { + "prefix": "po", + "description": "protected", + "body": "protected $0" + }, + "pu": { + "prefix": "pu", + "description": "public", + "body": "public $0" + }, + "re": { + "prefix": "re", + "description": "return", + "body": "return $0" + }, + "st": { + "prefix": "st", + "description": "static", + "body": "static $0" + }, + "sy": { + "prefix": "sy", + "description": "synchronized", + "body": "synchronized $0" + }, + "th": { + "prefix": "th", + "description": "throw", + "body": "throw new $0" + } +} diff --git a/luasnip_snippets/javascript-angular.json b/luasnip_snippets/javascript-angular.json new file mode 100644 index 0000000..9900256 --- /dev/null +++ b/luasnip_snippets/javascript-angular.json @@ -0,0 +1,32 @@ +{ + "iti": { + "prefix": "iti", + "description": "it (js, inject)", + "body": [ + "it('${1:description}', inject(function($2) {", + "\t$0", + "\\}));" + ], + "luasnip": { + "priority": -50 + } + }, + "befi": { + "prefix": "befi", + "description": "before each (js, inject)", + "body": [ + "beforeEach(inject(function($1) {", + "\t$0", + "\\}));" + ] + }, + "aconf": { + "prefix": "aconf", + "description": "angular config", + "body": [ + "config(function($1) {", + "\t$0", + "\\});" + ] + } +} diff --git a/luasnip_snippets/javascript-ember.json b/luasnip_snippets/javascript-ember.json new file mode 100644 index 0000000..008957a --- /dev/null +++ b/luasnip_snippets/javascript-ember.json @@ -0,0 +1,120 @@ +{ + "eapp": { + "prefix": "eapp", + "description": "App.Name = Ember.Application.create({});", + "body": [ + "import Application from '@ember/application';", + "", + "export default Application.extend({", + "\t${0://Properties here...}", + "\\});" + ], + "luasnip": { + "priority": -50 + } + }, + "emod": { + "prefix": "emod", + "description": "import DS from 'ember-data';", + "body": [ + "import DS from 'ember-data';", + "", + "export default DS.Model.extend({", + "\t${0://Properties here...}", + "\\});" + ] + }, + "econtroller": { + "prefix": "econtroller", + "description": "import Controller from '@ember/controller';", + "body": [ + "import Controller from '@ember/controller';", + "", + "export default Controller.extend({", + "\t${0://Properties here...}", + "\\});" + ] + }, + "eroute": { + "prefix": "eroute", + "description": "import Route from '@ember/routing/route';", + "body": [ + "import Route from '@ember/routing/route';", + "", + "export default Route.extend({", + "\t${0://Properties here...}", + "\\});" + ] + }, + "ecomponent": { + "prefix": "ecomponent", + "description": "import Component from '@ember/component';", + "body": [ + "import Component from '@ember/component';", + "", + "export default Component.extend({", + "\t${0://Properties here...}", + "\\});" + ] + }, + "eobj": { + "prefix": "eobj", + "description": "import EmberObject from '@ember/object';", + "body": [ + "import EmberObject from '@ember/object';", + "", + "export default EmberObject.extend({", + "\t${0://Properties here...}", + "\\});" + ] + }, + "emix": { + "prefix": "emix", + "description": "App.MixinName = Ember.Model.extend({...});", + "body": [ + "import Mixin from '@ember/object/mixin';", + "", + "export default Mixin.create({", + "\t${0://Properties here...}", + "\\});" + ] + }, + "eget": { + "prefix": "eget", + "description": "this.get('property');", + "body": "${1:this}.get('${2:property}');" + }, + "eset": { + "prefix": "eset", + "description": "this.set('property', value);", + "body": "${1:this}.set('${2:property}', ${3:value});" + }, + "cproimport": { + "prefix": "cproimport", + "description": "import { computed } from '@ember/object';", + "body": "import { computed \\} from '@ember/object';" + }, + "cpro": { + "prefix": "cpro", + "description": "property_name: computed('...', function() {...}),", + "body": [ + "${1:property_name}: computed('${3:argument}', function() {", + "\t${0://body...}", + "\\})," + ] + }, + "prooimport": { + "prefix": "prooimport", + "description": "import { observer } from '@ember/object';", + "body": "import { observer \\} from '@ember/object';" + }, + "proo": { + "prefix": "proo", + "description": "property_name: observer('...', function() {...}),", + "body": [ + "${1:property_name}: observer('${3:argument}', function() {", + "\t${0://body...}", + "\\})," + ] + } +} diff --git a/luasnip_snippets/javascript-jasmine-arrow.json b/luasnip_snippets/javascript-jasmine-arrow.json new file mode 100644 index 0000000..63b5142 --- /dev/null +++ b/luasnip_snippets/javascript-jasmine-arrow.json @@ -0,0 +1,68 @@ +{ + "des": { + "prefix": "des", + "description": "Describe (js)", + "body": [ + "describe('${1:description}', () => {", + "\t$0", + "\\});" + ], + "luasnip": { + "priority": -50 + } + }, + "it": { + "prefix": "it", + "description": "it (js)", + "body": [ + "it('${1:description}', () => {", + "\t$0", + "\\});" + ] + }, + "bef": { + "prefix": "bef", + "description": "before each (js)", + "body": [ + "beforeEach(() => {", + "\t$0", + "\\});" + ] + }, + "aft": { + "prefix": "aft", + "description": "after each (js)", + "body": [ + "afterEach(() => {", + "\t$0", + "\\});" + ] + }, + "befa": { + "prefix": "befa", + "description": "before all (js)", + "body": [ + "beforeAll(() => {", + "\t$0", + "\\});" + ] + }, + "afta": { + "prefix": "afta", + "description": "after all (js)", + "body": [ + "afterAll(() => {", + "\t$0", + "\\});" + ] + }, + "ru": { + "prefix": "ru", + "description": "runs (js)", + "body": [ + "runs(() => {", + "\t$0", + "\\});" + ] + } +} diff --git a/luasnip_snippets/javascript-jsdoc.json b/luasnip_snippets/javascript-jsdoc.json new file mode 100644 index 0000000..ed00fd4 --- /dev/null +++ b/luasnip_snippets/javascript-jsdoc.json @@ -0,0 +1,42 @@ +{ + "@li": { + "prefix": "@li", + "description": "@license Description", + "body": "@license ${1:MIT}$0" + }, + "@ver": { + "prefix": "@ver", + "description": "@version Semantic version", + "body": "@version ${1:0.1.0}$0" + }, + "@constr": { + "prefix": "@constr", + "description": "@constructor", + "body": "@constructor" + }, + "@p": { + "prefix": "@p", + "description": "@param {Type} varname Description", + "body": "@param {${1:Type}\\} ${2:varname} ${3:Description}" + }, + "@ret": { + "prefix": "@ret", + "description": "@return {Type} Description", + "body": "@return {${1:Type}\\} ${2:Description}" + }, + "@pri": { + "prefix": "@pri", + "description": "@private", + "body": "@private" + }, + "@over": { + "prefix": "@over", + "description": "@override", + "body": "@override" + }, + "@pro": { + "prefix": "@pro", + "description": "@protected", + "body": "@protected" + } +} diff --git a/luasnip_snippets/javascript-node.json b/luasnip_snippets/javascript-node.json new file mode 100644 index 0000000..975c697 --- /dev/null +++ b/luasnip_snippets/javascript-node.json @@ -0,0 +1,74 @@ +{ + "#!": { + "prefix": "#!", + "description": "#!/usr/bin/env node", + "body": "#!/usr/bin/env node", + "luasnip": { + "priority": -50 + } + }, + "ex": { + "prefix": "ex", + "description": "module.exports", + "body": "module.exports = $1;" + }, + "hcs": { + "prefix": "hcs", + "description": "http.createServer", + "body": "http.createServer($1).listen($2);" + }, + "ncs": { + "prefix": "ncs", + "description": "net.createServer", + "body": [ + "net.createServer(function(${1:socket}){", + "\t$1.on('data', function(${3:data}){", + "\t\t$4", + "\t\\});", + "\t$1.on('end', function(){", + "\t\t$5", + "\t\\});", + "\\}).listen(${6:8124});" + ] + }, + "pipe": { + "prefix": "pipe", + "description": "pipe", + "body": "pipe(${1:stream})$2" + }, + "eget": { + "prefix": "eget", + "description": "express GET", + "body": "${1:app}.get('$2', $3);" + }, + "epost": { + "prefix": "epost", + "description": "express POST", + "body": "${1:app}.post('$2', $3);" + }, + "eput": { + "prefix": "eput", + "description": "express PUT", + "body": "${1:app}.put('$2', $3);" + }, + "edelete": { + "prefix": "edelete", + "description": "express DELETE", + "body": "${1:app}.delete('$2', $3);" + }, + "stdout": { + "prefix": "stdout", + "description": "stdout", + "body": "process.stdout" + }, + "stdin": { + "prefix": "stdin", + "description": "stdin", + "body": "process.stdin" + }, + "stderr": { + "prefix": "stderr", + "description": "stderr", + "body": "process.stderr" + } +} diff --git a/luasnip_snippets/javascript.json b/luasnip_snippets/javascript.json new file mode 100644 index 0000000..7b9e33f --- /dev/null +++ b/luasnip_snippets/javascript.json @@ -0,0 +1,17 @@ +{ + ":,": { + "prefix": ":,", + "description": "Object Value JS", + "body": "${1:value_name}: ${0:value}," + }, + ":": { + "prefix": ":", + "description": "Object key key: 'value'", + "body": "${1:key}: ${2:\"${3:value}\"}${4:, }" + }, + "imp": { + "prefix": "imp", + "description": "import", + "body": "import $2 from $1" + } +} diff --git a/luasnip_snippets/javascript_react.json b/luasnip_snippets/javascript_react.json new file mode 100644 index 0000000..02bbaaa --- /dev/null +++ b/luasnip_snippets/javascript_react.json @@ -0,0 +1,54 @@ +{ + "useE": { + "prefix": "useE", + "description": "useEffect Hook", + "body": [ + "useEffect(() => {", + "\t${1:$0}", + "\t\t\\}$2)" + ] + }, + "useC": { + "prefix": "useC", + "description": "useContext Hook", + "body": "const ${1:context} = useContext($2)" + }, + "useRe": { + "prefix": "useRe", + "description": "useReducer Hook", + "body": "const [${3:state}, ${4:dispatch}] = useReducer(${5:reducer}, ${2:initial_value})" + }, + "useCB": { + "prefix": "useCB", + "description": "useCallback(fn, inputs)", + "body": [ + "const ${1:callback} = useCallback(($2)) => ${3:{", + "\t$4", + "\\}}, [$5])" + ] + }, + "useM": { + "prefix": "useM", + "description": "useMemo(fn, inputs)", + "body": [ + "const ${1:memorized} = useMemo(() => ${2:{", + "\t$3", + "\\}}, [$4])" + ] + }, + "useR": { + "prefix": "useR", + "description": "useRef(defaultValue)", + "body": "const ${1:ref} = useRef(${2:null})" + }, + "ir": { + "prefix": "ir", + "description": "import React", + "body": "import React from \"react\"" + }, + "irc": { + "prefix": "irc", + "description": "import React and Component", + "body": "import React, { Component \\} from \"react\"" + } +} diff --git a/luasnip_snippets/jinja2.json b/luasnip_snippets/jinja2.json new file mode 100644 index 0000000..622b06b --- /dev/null +++ b/luasnip_snippets/jinja2.json @@ -0,0 +1,186 @@ +{ + "block": { + "prefix": "block", + "description": "block", + "body": [ + "{% block ${1:name} %\\}", + "\t\t$2", + "{% endblock $1 %\\}" + ], + "luasnip": { + "priority": -50 + } + }, + "{{": { + "prefix": "{{", + "description": "variable", + "body": "{{ $1 \\}\\}" + }, + "{#": { + "prefix": "{#", + "description": "comment", + "body": "{# $1 #\\}" + }, + "#": { + "prefix": "#", + "description": "comment", + "body": "{# $1 #\\}" + }, + "raw": { + "prefix": "raw", + "description": "escaped block", + "body": [ + "{% raw %\\}", + "\t\t$1", + "{% endraw %\\}" + ] + }, + "extends": { + "prefix": "extends", + "description": "extends", + "body": "{% extends \"${1:template}\" %\\}" + }, + "include": { + "prefix": "include", + "description": "include", + "body": "{% include \"${1:template}\" %\\}" + }, + "import": { + "prefix": "import", + "description": "import", + "body": "{% import \"${1:template}\" %\\}" + }, + "from": { + "prefix": "from", + "description": "from/import/as", + "body": "{% from \"${1:template}\" import ${2:name}${3: as ${4:$2}} %\\}" + }, + "filter": { + "prefix": "filter", + "description": "filter", + "body": [ + "{% filter ${1:filter} %\\}", + "\t$2", + "{% endfilter %\\}" + ] + }, + "for": { + "prefix": "for", + "description": "for/else", + "body": [ + "{% for ${1:item} in ${2:sequence} %\\}", + "\t$3", + "{% else %\\}", + "\t$4", + "{% endfor %\\}" + ] + }, + "if": { + "prefix": "if", + "description": "if/elif/else", + "body": [ + "{% if ${1:expr} %\\}", + "\t$2", + "{% elif %\\}", + "\t$3", + "{% else %\\}", + "\t$4", + "{% endif %\\}" + ] + }, + "macro": { + "prefix": "macro", + "description": "macro", + "body": [ + "{% macro ${1:name}(${2:args}) %\\}", + "\t$3", + "{% endmacro %\\}" + ] + }, + "call": { + "prefix": "call", + "description": "call", + "body": [ + "{% call ${1:name}(${2:args}) %\\}", + "\t$3", + "{% endcall %\\}" + ] + }, + "set": { + "prefix": "set", + "description": "set", + "body": "{% set ${1:name} = ${2:'value'} %\\}" + }, + "trans": { + "prefix": "trans", + "description": "translation", + "body": [ + "{% trans %\\}", + "\t$1", + "{% endtrans %\\}" + ] + }, + "with": { + "prefix": "with", + "description": "with", + "body": [ + "{% with %\\}", + "\t$1", + "{% endwith %\\}" + ] + }, + "autoescape": { + "prefix": "autoescape", + "description": "autoescape", + "body": [ + "{% autoescape ${1:true} %\\}", + "\t$2", + "{% endautoescape %\\}" + ] + }, + "batch": { + "prefix": "batch", + "description": "batch items", + "body": "batch(linecount=$1, fill_with=${2:None})" + }, + "dictsort": { + "prefix": "dictsort", + "description": "sort and yield (key, value) pairs", + "body": "dictsort(case_sensitive=${1:False}, by=${2:'key'})" + }, + "round": { + "prefix": "round", + "description": "round number", + "body": "round(precision=${1:0}, method=${2:'common|ceil|floor'})" + }, + "urlize": { + "prefix": "urlize", + "description": "convert plain-text url to <a/>", + "body": "urlize(trim_url_limit=${1:None}, nofollow=${2:False})" + }, + "wordwrap": { + "prefix": "wordwrap", + "description": "wordwrap", + "body": "wordwrap(width=${1:79}, break_long_words=${2:True})" + }, + "truncate": { + "prefix": "truncate", + "description": "truncate", + "body": "truncate(lenght=${1:79}, killwords=${2:False}, end=${3:'...''})" + }, + "sum": { + "prefix": "sum", + "description": "sum of sequence of numbers + start", + "body": "sum(attribute=${1:None}, start=${2:0})" + }, + "sort": { + "prefix": "sort", + "description": "sort an iterable", + "body": "sort(reverse=${1:False}, case_sensitive=${2:False}, attribute=${3:None})" + }, + "indent": { + "prefix": "indent", + "description": "indent", + "body": "indent(width=${1:4}, indentfirst=${2:False})" + } +} diff --git a/luasnip_snippets/json.json b/luasnip_snippets/json.json new file mode 100644 index 0000000..4a5438b --- /dev/null +++ b/luasnip_snippets/json.json @@ -0,0 +1,20 @@ +{ + "s": { + "prefix": "s", + "description": "String", + "body": "\"${1:key}\": \"${0:value}\",", + "luasnip": { + "priority": -50 + } + }, + "n": { + "prefix": "n", + "description": "Number", + "body": "\"${1:key}\": ${0:value}," + }, + "null": { + "prefix": "null", + "description": "Null", + "body": "\"${0:key}\": null," + } +} diff --git a/luasnip_snippets/julia.json b/luasnip_snippets/julia.json new file mode 100644 index 0000000..01fea82 --- /dev/null +++ b/luasnip_snippets/julia.json @@ -0,0 +1,54 @@ +{ + "docf": { + "prefix": "docf", + "description": "function documentation", + "body": [ + "#' @description", + "#'", + "#' ${1:function description}", + "#'", + "#' ${2:@param ${3:name}::${4:Type} ${5:Description}}", + "#'", + "#' ${6:@returns ${7:name}::${8:Type} ${9:Description}}", + "#'", + "#' @examples", + "#'", + "#' ${10: function call examples}" + ] + }, + "doct": { + "prefix": "doct", + "description": "type definition", + "body": [ + "#' @description", + "#'", + "#' ${1:type description}", + "#'", + "#' ${2:@field ${3:name}::${4:Type} ${5:Description}}", + "#'", + "#' @examples", + "#'", + "#' ${10: constructor examples}" + ] + }, + "par": { + "prefix": "par", + "description": "function parameter documentation", + "body": "#' @param ${1:name}::${2:Type} ${0:Description}" + }, + "fld": { + "prefix": "fld", + "description": "type field documentation", + "body": "#' @field ${1:name}::${2:Type} ${0:Description}" + }, + "deb": { + "prefix": "deb", + "description": "Debugger breakpoint", + "body": "Main.@bp" + }, + "inf": { + "prefix": "inf", + "description": "Infiltrator breakpoint", + "body": "Main.@infiltrate" + } +} diff --git a/luasnip_snippets/ledger.json b/luasnip_snippets/ledger.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/ledger.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/lhaskell.json b/luasnip_snippets/lhaskell.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/lhaskell.json @@ -0,0 +1 @@ +{} 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')" + } +} diff --git a/luasnip_snippets/mako.json b/luasnip_snippets/mako.json new file mode 100644 index 0000000..fb08ff9 --- /dev/null +++ b/luasnip_snippets/mako.json @@ -0,0 +1,116 @@ +{ + "def": { + "prefix": "def", + "description": "definition", + "body": [ + "<%def name=\"${1:name}\">", + "\t${2:}", + "</%def>" + ], + "luasnip": { + "priority": -50 + } + }, + "call": { + "prefix": "call", + "description": "call", + "body": [ + "<%call expr=\"${1:name}\">", + "\t${2:}", + "</%call>" + ] + }, + "doc": { + "prefix": "doc", + "description": "doc", + "body": [ + "<%doc>", + "\t${1:}", + "</%doc>" + ] + }, + "text": { + "prefix": "text", + "description": "text", + "body": [ + "<%text>", + "\t${1:}", + "</%text>" + ] + }, + "for": { + "prefix": "for", + "description": "for", + "body": [ + "% for ${1:i} in ${2:iter}:", + "\t${3:}", + "% endfor" + ] + }, + "if": { + "prefix": "if", + "description": "if/else", + "body": [ + "% if ${1:condition}:", + "\t${2:}", + "% else:", + "\t${3:}", + "% endif" + ] + }, + "try": { + "prefix": "try", + "description": "try", + "body": [ + "% try:", + "\t${1:}", + "% except${2:}:", + "\t${3:pass}", + "% endtry" + ] + }, + "wh": { + "prefix": "wh", + "description": "wh", + "body": [ + "% while ${1:}:", + "\t${2:}", + "% endwhile" + ] + }, + "$": { + "prefix": "$", + "description": "$", + "body": "\\${${1:}\\}" + }, + "<%": { + "prefix": "<%", + "description": "<%", + "body": "<% ${1:} %>" + }, + "<!%": { + "prefix": "<!%", + "description": "<!%", + "body": "<!% ${1:} %>" + }, + "inherit": { + "prefix": "inherit", + "description": "inherit", + "body": "<%inherit file=\"${1:filename}\" />" + }, + "include": { + "prefix": "include", + "description": "include", + "body": "<%include file=\"${1:filename}\" />" + }, + "namespace": { + "prefix": "namespace", + "description": "namespace", + "body": "<%namespace file=\"${1:name}\" />" + }, + "page": { + "prefix": "page", + "description": "page", + "body": "<%page args=\"${1:}\" />" + } +} diff --git a/luasnip_snippets/markdown.json b/luasnip_snippets/markdown.json new file mode 100644 index 0000000..e5e4ef0 --- /dev/null +++ b/luasnip_snippets/markdown.json @@ -0,0 +1,54 @@ +{ + "sec": { + "prefix": "sec", + "description": "Section", + "body": [ + "# ${1:Section Name} #", + "$0" + ], + "luasnip": { + "priority": -50 + } + }, + "ssec": { + "prefix": "ssec", + "description": "Sub Section", + "body": [ + "## ${1:Section Name} ##", + "$0" + ] + }, + "sssec": { + "prefix": "sssec", + "description": "SubSub Section", + "body": [ + "### ${1:Section Name} ###", + "$0" + ] + }, + "par": { + "prefix": "par", + "description": "Paragraph", + "body": [ + "#### ${1:Paragraph Name} ####", + "$0" + ] + }, + "spar": { + "prefix": "spar", + "description": "Paragraph", + "body": [ + "##### ${1:Paragraph Name} #####", + "$0" + ] + }, + "detail": { + "prefix": "detail", + "description": "Disclosure", + "body": [ + "<details${3: open=\"\"}>", + " ${1:<summary>$2</summary>}$0", + "</details>" + ] + } +} diff --git a/luasnip_snippets/matlab.json b/luasnip_snippets/matlab.json new file mode 100644 index 0000000..438740f --- /dev/null +++ b/luasnip_snippets/matlab.json @@ -0,0 +1,17 @@ +{ + "switch": { + "prefix": "switch", + "description": "switch ... otherwise", + "body": [ + "switch ${1:n}", + "\tcase ${2:0}", + "\t\t$3${4:", + "\totherwise", + "\t\t$5}", + "end" + ], + "luasnip": { + "priority": -50 + } + } +} diff --git a/luasnip_snippets/objc.json b/luasnip_snippets/objc.json new file mode 100644 index 0000000..8f144bd --- /dev/null +++ b/luasnip_snippets/objc.json @@ -0,0 +1,120 @@ +{ + "Imp": { + "prefix": "Imp", + "description": "#import <> (Imp)", + "body": "#import <${1:Cocoa/Cocoa.h}>" + }, + "array": { + "prefix": "array", + "description": "NSArray (array)", + "body": "NSMutableArray *${1:array} = [NSMutableArray array];" + }, + "dict": { + "prefix": "dict", + "description": "NSDictionary (dict)", + "body": "NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];" + }, + "forarray": { + "prefix": "forarray", + "description": "for NSArray loop (forarray)", + "body": [ + "unsigned int\t${1:object}Count = [${2:array} count];", + "", + "for(unsigned int index = 0; index < $1Count; index += 1)", + "{", + "\t${3:id}\t$1 = [$2 objectAtIndex:index];", + "\t$0", + "\\}" + ] + }, + "sel": { + "prefix": "sel", + "description": "@selector", + "body": "@selector(${1:method}:)" + }, + "thread": { + "prefix": "thread", + "description": "Detach New NSThread", + "body": "[NSThread detachNewThreadSelector:@selector(${1:method}:) toTarget:${2:aTarget} withObject:${3:anArgument}]" + }, + "I": { + "prefix": "I", + "description": "Initialize Implementation (I)", + "body": [ + "+ (void)initialize", + "{", + "\t[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:", + "\t\t$0@\"value\", @\"key\",", + "\t\tnil]];", + "\\}" + ] + }, + "bind": { + "prefix": "bind", + "description": "Key:value binding (bind)", + "body": "bind:@\"${1:binding}\" toObject:${2:observableController} withKeyPath:@\"${3:keyPath}\" options:${4:nil}" + }, + "focus": { + "prefix": "focus", + "description": "Lock Focus", + "body": [ + "[self lockFocus];", + "$0", + "[self unlockFocus];" + ] + }, + "pool": { + "prefix": "pool", + "description": "NSAutoreleasePool (pool)", + "body": [ + "NSAutoreleasePool *pool = [NSAutoreleasePool new];", + "$0", + "[pool drain];" + ] + }, + "alert": { + "prefix": "alert", + "description": "NSRunAlertPanel (alert)", + "body": [ + "int choice = NSRunAlertPanel(@\"${1:Something important!}\", @\"${2:Something important just happend, and now I need to ask you, do you want to continue?}\", @\"${3:Continue}\", @\"${4:Cancel}\", nil);", + "if(choice == NSAlertDefaultReturn) // \"$3\"", + "{", + "\t$0;", + "\\}", + "else if(choice == NSAlertAlternateReturn) // \"$4\"", + "{", + "\t\t$0", + "\\}" + ] + }, + "format": { + "prefix": "format", + "description": "NSString stringWithFormat (format)", + "body": "[NSString stringWithFormat:@\"$1\", $2]$0" + }, + "getprefs": { + "prefix": "getprefs", + "description": "Read from defaults (getprefs)", + "body": "[[NSUserDefaults standardUserDefaults] objectForKey:${1:key}];" + }, + "gsave": { + "prefix": "gsave", + "description": "Save and Restore Graphics Context (gsave)", + "body": [ + "[NSGraphicsContext saveGraphicsState];", + "$0", + "[NSGraphicsContext restoreGraphicsState];", + "" + ] + }, + "syn": { + "prefix": "syn", + "description": "Synthesize", + "body": "@synthesize ${1:property};" + }, + "setprefs": { + "prefix": "setprefs", + "description": "Write to defaults (setprefs)", + "body": "[[NSUserDefaults standardUserDefaults] setObject:${1:object} forKey:${2:key}];" + } +} diff --git a/luasnip_snippets/ocaml.json b/luasnip_snippets/ocaml.json new file mode 100644 index 0000000..2e97c60 --- /dev/null +++ b/luasnip_snippets/ocaml.json @@ -0,0 +1,260 @@ +{ + "rs": { + "prefix": "rs", + "description": "raise", + "body": "raise (${1:Not_found})", + "luasnip": { + "priority": -50 + } + }, + "open": { + "prefix": "open", + "description": "open", + "body": [ + "let open ${1:module} in", + "${2:e}" + ] + }, + "try": { + "prefix": "try", + "description": "try", + "body": [ + "try ${1:e}", + "with ${2:Not_found} -> ${3:()}" + ] + }, + "ref": { + "prefix": "ref", + "description": "ref", + "body": [ + "let ${1:name} = ref ${2:val} in", + "${3:e}" + ] + }, + "matchl": { + "prefix": "matchl", + "description": "pattern match on a list", + "body": [ + "match ${1:list} with", + "| [] -> ${2:()}", + "| x::xs -> ${3:()}" + ] + }, + "matcho": { + "prefix": "matcho", + "description": "pattern match on an option type", + "body": [ + "match ${1:x} with", + "| Some(${2:y}) -> ${3:()}", + "| None -> ${4:()}" + ] + }, + "fun": { + "prefix": "fun", + "description": "anonymous function", + "body": "(fun ${1:x} -> ${2:x})" + }, + "cc": { + "prefix": "cc", + "description": "commment", + "body": "(* ${1:comment} *)" + }, + "let": { + "prefix": "let", + "description": "let .. in binding", + "body": [ + "let ${1:x} = ${2:v} in", + "${3:e}" + ] + }, + "lr": { + "prefix": "lr", + "description": "let rec", + "body": [ + "let rec ${1:f} =", + "\t${2:expr}" + ] + }, + "if": { + "prefix": "if", + "description": "if", + "body": [ + "if ${1:(* condition *)} then", + "\t${2:(* A *)}", + "else", + "\t${3:(* B *)}" + ] + }, + "If": { + "prefix": "If", + "description": "If", + "body": [ + "if ${1:(* condition *)} then", + "\t${2:(* A *)}" + ] + }, + "while": { + "prefix": "while", + "description": "while", + "body": [ + "while ${1:(* condition *)} do", + "\t${2:(* A *)}", + "done" + ] + }, + "for": { + "prefix": "for", + "description": "for", + "body": [ + "for ${1:i} = ${2:1} to ${3:10} do", + "\t${4:(* BODY *)}", + "done" + ] + }, + "match": { + "prefix": "match", + "description": "match", + "body": [ + "match ${1:(* e1 *)} with", + "| ${2:p} -> ${3:e2}" + ] + }, + "Match": { + "prefix": "Match", + "description": "match", + "body": [ + "match ${1:(* e1 *)} with", + "| ${2:p} -> ${3:e2}" + ] + }, + "class": { + "prefix": "class", + "description": "class", + "body": [ + "class ${1:name} = object", + "\t${2:methods}", + "end" + ] + }, + "obj": { + "prefix": "obj", + "description": "obj", + "body": [ + "object", + "\t${2:methods}", + "end" + ] + }, + "Obj": { + "prefix": "Obj", + "description": "object", + "body": [ + "object (self)", + "\t${2:methods}", + "end" + ] + }, + "{{": { + "prefix": "{{", + "description": "object functional update", + "body": "{< ${1:x} = ${2:y} >\\}" + }, + "beg": { + "prefix": "beg", + "description": "beg", + "body": [ + "begin", + "\t${1:block}", + "end" + ] + }, + "ml": { + "prefix": "ml", + "description": "module instantiantion with functor", + "body": "module ${1:Mod} = ${2:Functor}(${3:Arg})" + }, + "mod": { + "prefix": "mod", + "description": "module - no signature", + "body": [ + "module ${1:(* Name *)} = struct", + "\t${2:(* BODY *)}", + "end" + ] + }, + "Mod": { + "prefix": "Mod", + "description": "module with signature", + "body": [ + "module ${1:(* Name *)} : ${2:(* SIG *)} = struct", + "\t${3:(* BODY *)}", + "end" + ] + }, + "sig": { + "prefix": "sig", + "description": "anonymous signature", + "body": [ + "sig", + "\t${2:(* BODY *)}", + "end" + ] + }, + "sigf": { + "prefix": "sigf", + "description": "functor signature or anonymous functor", + "body": "functor (${1:Arg} : ${2:ARG}) -> ${3:(* BODY *)}" + }, + "func": { + "prefix": "func", + "description": "define functor - no signature", + "body": [ + "module ${1:M} (${2:Arg} : ${3:ARG}) = struct", + "\t${4:(* BODY *)}", + "end" + ] + }, + "Func": { + "prefix": "Func", + "description": "define functor - with signature", + "body": [ + "module ${1:M} (${2:Arg} : ${3:ARG}) : ${4:SIG} = struct", + "\t${5:(* BODY *)}", + "end" + ] + }, + "mot": { + "prefix": "mot", + "description": "Declare module signature", + "body": [ + "module type ${1:(* Name *)} = sig", + "\t${2:(* BODY *)}", + "end" + ] + }, + "module": { + "prefix": "module", + "description": "Module with anonymous signature", + "body": [ + "module ${1:(* Name *)} : sig", + "\t${2:(* SIGNATURE *)}", + "end = struct", + "\t${3:(* BODY *)}", + "end" + ] + }, + "oo": { + "prefix": "oo", + "description": "odoc", + "body": "(** ${1:odoc} *)" + }, + "qt": { + "prefix": "qt", + "description": "inline qtest", + "body": [ + "(*\\$T ${1:name}", + "\t${2:test}", + "*)" + ] + } +} diff --git a/luasnip_snippets/octave.json b/luasnip_snippets/octave.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/octave.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/package.json b/luasnip_snippets/package.json new file mode 100644 index 0000000..705735e --- /dev/null +++ b/luasnip_snippets/package.json @@ -0,0 +1,340 @@ +{ + "name": "1", + "description": "Generated by snippet-converter.nvim (https://github.com/smjonas/snippet-converter.nvim)", + "contributes": { + "snippets": [ + { + "language": "php-phpspec", + "path": "./php-phpspec.json" + }, + { + "language": "php-symfony2", + "path": "./php-symfony2.json" + }, + { + "language": "robot", + "path": "./robot.json" + }, + { + "language": "soy", + "path": "./soy.json" + }, + { + "language": "texmath", + "path": "./texmath.json" + }, + { + "language": "typescript_react", + "path": "./typescript_react.json" + }, + { + "language": "lua", + "path": "./lua.json" + }, + { + "language": "snippets", + "path": "./snippets.json" + }, + { + "language": "eruby", + "path": "./eruby.json" + }, + { + "language": "cuda", + "path": "./cuda.json" + }, + { + "language": "haskell", + "path": "./haskell.json" + }, + { + "language": "rust", + "path": "./rust.json" + }, + { + "language": "zsh", + "path": "./zsh.json" + }, + { + "language": "ledger", + "path": "./ledger.json" + }, + { + "language": "puppet", + "path": "./puppet.json" + }, + { + "language": "xhtml", + "path": "./xhtml.json" + }, + { + "language": "plsql", + "path": "./plsql.json" + }, + { + "language": "tex", + "path": "./tex.json" + }, + { + "language": "c", + "path": "./c.json" + }, + { + "language": "bib", + "path": "./bib.json" + }, + { + "language": "crystal", + "path": "./crystal.json" + }, + { + "language": "ada", + "path": "./ada.json" + }, + { + "language": "ruby", + "path": "./ruby.json" + }, + { + "language": "elm", + "path": "./elm.json" + }, + { + "language": "perl", + "path": "./perl.json" + }, + { + "language": "help", + "path": "./help.json" + }, + { + "language": "php", + "path": "./php.json" + }, + { + "language": "java", + "path": "./java.json" + }, + { + "language": "rst", + "path": "./rst.json" + }, + { + "language": "blade", + "path": "./blade.json" + }, + { + "language": "cpp", + "path": "./cpp.json" + }, + { + "language": "python", + "path": "./python.json" + }, + { + "language": "ejs", + "path": "./ejs.json" + }, + { + "language": "css", + "path": "./css.json" + }, + { + "language": "django", + "path": "./django.json" + }, + { + "language": "objc", + "path": "./objc.json" + }, + { + "language": "ocaml", + "path": "./ocaml.json" + }, + { + "language": "coffee", + "path": "./coffee.json" + }, + { + "language": "erlang", + "path": "./erlang.json" + }, + { + "language": "eelixir", + "path": "./eelixir.json" + }, + { + "language": "proto", + "path": "./proto.json" + }, + { + "language": "javascript", + "path": "./javascript.json" + }, + { + "language": "json", + "path": "./json.json" + }, + { + "language": "vim", + "path": "./vim.json" + }, + { + "language": "rnoweb", + "path": "./rnoweb.json" + }, + { + "language": "gitcommit", + "path": "./gitcommit.json" + }, + { + "language": "r", + "path": "./r.json" + }, + { + "language": "html", + "path": "./html.json" + }, + { + "language": "supercollider", + "path": "./supercollider.json" + }, + { + "language": "d", + "path": "./d.json" + }, + { + "language": "typescript", + "path": "./typescript.json" + }, + { + "language": "markdown", + "path": "./markdown.json" + }, + { + "language": "go", + "path": "./go.json" + }, + { + "language": "tcl", + "path": "./tcl.json" + }, + { + "language": "htmldjango", + "path": "./htmldjango.json" + }, + { + "language": "jinja2", + "path": "./jinja2.json" + }, + { + "language": "vue", + "path": "./vue.json" + }, + { + "language": "rails", + "path": "./rails.json" + }, + { + "language": "all", + "path": "./all.json" + }, + { + "language": "lhaskell", + "path": "./lhaskell.json" + }, + { + "language": "julia", + "path": "./julia.json" + }, + { + "language": "pandoc", + "path": "./pandoc.json" + }, + { + "language": "matlab", + "path": "./matlab.json" + }, + { + "language": "cs", + "path": "./cs.json" + }, + { + "language": "xml", + "path": "./xml.json" + }, + { + "language": "sh", + "path": "./sh.json" + }, + { + "language": "svelte", + "path": "./svelte.json" + }, + { + "language": "bindzone", + "path": "./bindzone.json" + }, + { + "language": "coffee-jasmine", + "path": "./coffee-jasmine.json" + }, + { + "language": "coffee-react", + "path": "./coffee-react.json" + }, + { + "language": "html_minimal", + "path": "./html_minimal.json" + }, + { + "language": "htmljinja", + "path": "./htmljinja.json" + }, + { + "language": "javascript-angular", + "path": "./javascript-angular.json" + }, + { + "language": "javascript-ember", + "path": "./javascript-ember.json" + }, + { + "language": "javascript-jasmine-arrow", + "path": "./javascript-jasmine-arrow.json" + }, + { + "language": "javascript-jsdoc", + "path": "./javascript-jsdoc.json" + }, + { + "language": "javascript-node", + "path": "./javascript-node.json" + }, + { + "language": "javascript_react", + "path": "./javascript_react.json" + }, + { + "language": "mako", + "path": "./mako.json" + }, + { + "language": "octave", + "path": "./octave.json" + }, + { + "language": "php-laravel", + "path": "./php-laravel.json" + }, + { + "language": "html", + "path": "./html.json" + }, + { + "language": "jinja2", + "path": "./jinja2.json" + } + ] + } +} diff --git a/luasnip_snippets/pandoc.json b/luasnip_snippets/pandoc.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/pandoc.json @@ -0,0 +1 @@ +{} 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...}", + "\\}", + "" + ] + } +} diff --git a/luasnip_snippets/php-laravel.json b/luasnip_snippets/php-laravel.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/php-laravel.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/php-phpspec.json b/luasnip_snippets/php-phpspec.json new file mode 100644 index 0000000..70b77f0 --- /dev/null +++ b/luasnip_snippets/php-phpspec.json @@ -0,0 +1,202 @@ +{ + "cw": { + "prefix": "cw", + "description": "$this->beConstructedWith($arg)", + "body": "\\$this->beConstructedWith($1);" + }, + "ct": { + "prefix": "ct", + "description": "$this->beConstructedThrough($methodName, [$arg])", + "body": "\\$this->beConstructedThrough(${1:'methodName'}, [${2:'\\$arg'}]);" + }, + "sreturn": { + "prefix": "sreturn", + "description": "$this->XYZ()->shouldReturn('value')", + "body": "\\$this->${1:method}()->shouldReturn(${2:'value'});" + }, + "snreturn": { + "prefix": "snreturn", + "description": "$this->XYZ()->shouldNotReturn('value')", + "body": "\\$this->${1:method}()->shouldNotReturn(${2:'value'});" + }, + "sbe": { + "prefix": "sbe", + "description": "$this->XYZ()->shouldBe('value')", + "body": "\\$this->${1:method}()->shouldBe(${2:'value'});" + }, + "snbe": { + "prefix": "snbe", + "description": "$this->XYZ()->shouldNotBe('value')", + "body": "\\$this->${1:method}()->shouldNotBe(${2:'value'});" + }, + "sequal": { + "prefix": "sequal", + "description": "$this->XYZ()->shouldEqual('value')", + "body": "\\$this->${1:method}()->shouldEqual(${2:'value'});" + }, + "snequal": { + "prefix": "snequal", + "description": "$this->XYZ()->shouldNotEqual('value')", + "body": "\\$this->${1:method}()->shouldNotEqual(${2:'value'});" + }, + "sbequalto": { + "prefix": "sbequalto", + "description": "$this->XYZ()->shouldBeEqualTo('value')", + "body": "\\$this->${1:method}()->shouldBeEqualTo(${2:'value'});" + }, + "snbequalto": { + "prefix": "snbequalto", + "description": "$this->XYZ()->shouldNotBeEqualTo('value')", + "body": "\\$this->${1:method}()->shouldNotBeEqualTo(${2:'value'});" + }, + "sblike": { + "prefix": "sblike", + "description": "$this->XYZ()->shouldBeLike('value')", + "body": "\\$this->${1:method}()->shouldBeLike(${2:'value'});" + }, + "snblike": { + "prefix": "snblike", + "description": "$this->XYZ()->shouldNotBeLike('value')", + "body": "\\$this->${1:method}()->shouldNotBeLike(${2:'value'});" + }, + "sthrowm": { + "prefix": "sthrowm", + "description": "$this->shouldThrow('\\Exception')->duringXYZ($arg)", + "body": "\\$this->shouldThrow(${1:'\\Exception'})->during${2:Method}(${3:'\\$arg'});" + }, + "sthrowi": { + "prefix": "sthrowi", + "description": "$this->shouldThrow('\\Exception')->duringInstantiation()", + "body": "\\$this->shouldThrow(${1:'\\Exception'})->duringInstantiation();" + }, + "stype": { + "prefix": "stype", + "description": "$this->shouldHaveType('Type')", + "body": "\\$this->shouldHaveType($1);" + }, + "sntype": { + "prefix": "sntype", + "description": "$this->shouldNotHaveType('Type')", + "body": "\\$this->shouldNotHaveType($1);" + }, + "srinstance": { + "prefix": "srinstance", + "description": "$this->shouldReturnAnInstanceOf('Type')", + "body": "\\$this->shouldReturnAnInstanceOf($1);" + }, + "snrinstance": { + "prefix": "snrinstance", + "description": "$this->shouldNotReturnAnInstanceOf('Type')", + "body": "\\$this->shouldNotReturnAnInstanceOf($1);" + }, + "sbinstance": { + "prefix": "sbinstance", + "description": "$this->shouldBeAnInstanceOf('Type')", + "body": "\\$this->shouldBeAnInstanceOf($1);" + }, + "snbinstance": { + "prefix": "snbinstance", + "description": "$this->shouldNotBeAnInstanceOf('Type')", + "body": "\\$this->shouldNotBeAnInstanceOf($1);" + }, + "simplement": { + "prefix": "simplement", + "description": "$this->shouldImplement('Type')", + "body": "\\$this->shouldImplement($1);" + }, + "snimplement": { + "prefix": "snimplement", + "description": "$this->shouldNotImplement('Type')", + "body": "\\$this->shouldNotImplement($1);" + }, + "sbstate": { + "prefix": "sbstate", + "description": "$this->shouldBeXYZ()", + "body": "\\$this->shouldBe$1();" + }, + "snbstate": { + "prefix": "snbstate", + "description": "$this->shouldNotBeXYZ()", + "body": "\\$this->shouldNotBe$1();" + }, + "scount": { + "prefix": "scount", + "description": "$this->XYZ()->shouldHaveCount(7)", + "body": "\\$this->${1:method}()->shouldHaveCount(${2:7});" + }, + "sncount": { + "prefix": "sncount", + "description": "$this->XYZ()->shouldNotHaveCount(7)", + "body": "\\$this->${1:method}()->shouldNotHaveCount(${2:7});" + }, + "sbscalar": { + "prefix": "sbscalar", + "description": "$this->XYZ()->shouldBeString|Array|Bool()", + "body": "\\$this->${1:method}()->shouldBe${2:String|Array|Bool}();" + }, + "snbscalar": { + "prefix": "snbscalar", + "description": "$this->XYZ()->shouldNotBeString|Array|Bool()", + "body": "\\$this->${1:method}()->shouldNotBe${2:String|Array|Bool}();" + }, + "scontain": { + "prefix": "scontain", + "description": "$this->XYZ()->shouldContain('value')", + "body": "\\$this->${1:method}()->shouldContain(${2:'value'});" + }, + "sncontain": { + "prefix": "sncontain", + "description": "$this->XYZ()->shouldNotContain('value')", + "body": "\\$this->${1:method}()->shouldNotContain(${2:'value'});" + }, + "skey": { + "prefix": "skey", + "description": "$this->XYZ()->shouldHaveKey('key')", + "body": "\\$this->${1:method}()->shouldHaveKey(${2:'key'});" + }, + "snkey": { + "prefix": "snkey", + "description": "$this->XYZ()->shouldNotHaveKey('key')", + "body": "\\$this->${1:method}()->shouldNotHaveKey(${2:'key'});" + }, + "skeyvalue": { + "prefix": "skeyvalue", + "description": "$this->XYZ()->shouldHaveKeyWithValue('key', 'value')", + "body": "\\$this->${1:method}()->shouldHaveKeyWithValue(${2:'key'}, ${3:'value'});" + }, + "snkeyvalue": { + "prefix": "snkeyvalue", + "description": "$this->XYZ()->shouldNotHaveKeyWithValue('key', 'value')", + "body": "\\$this->${1:method}()->shouldNotHaveKeyWithValue(${2:'key'}, ${3:'value'});" + }, + "sstart": { + "prefix": "sstart", + "description": "$this->XYZ()->shouldStartWith('string')", + "body": "\\$this->${1:method}()->shouldStartWith(${2:'string'});" + }, + "snstart": { + "prefix": "snstart", + "description": "$this->XYZ()->shouldNotStartWith('string')", + "body": "\\$this->${1:method}()->shouldNotStartWith(${2:'string'});" + }, + "send": { + "prefix": "send", + "description": "$this->XYZ()->shouldEndWith('string')", + "body": "\\$this->${1:method}()->shouldEndWith(${2:'string'});" + }, + "snend": { + "prefix": "snend", + "description": "$this->XYZ()->shouldNotEndWith('string')", + "body": "\\$this->${1:method}()->shouldNotEndWith(${2:'string'});" + }, + "smatch": { + "prefix": "smatch", + "description": "$this->XYZ()->shouldMatch('/wizard/i')", + "body": "\\$this->${1:method}()->shouldMatch(${2:'/wizard/i'});" + }, + "snmatch": { + "prefix": "snmatch", + "description": "$this->XYZ()->shouldNotMatch('/wizard/i')", + "body": "\\$this->${1:method}()->shouldNotMatch(${2:'/wizard/i'});" + } +} diff --git a/luasnip_snippets/php-symfony2.json b/luasnip_snippets/php-symfony2.json new file mode 100644 index 0000000..d7776f9 --- /dev/null +++ b/luasnip_snippets/php-symfony2.json @@ -0,0 +1,97 @@ +{ + "sfa": { + "prefix": "sfa", + "description": "Symfony 2 Controller action", + "body": [ + "/**", + "* @Route(\"/${1:route_name}\", name=\"$1\")", + "* @Template()", + "*/", + "public function $1Action($2)", + "{", + "\t$3", + "\treturn ${4:[];}$0", + "\\}" + ] + }, + "act": { + "prefix": "act", + "description": "Symfony2 action", + "body": [ + "/**", + " * @Route(\"$3\", name=\"$4\")", + " * @Method({${5:\"POST\"}\\})", + " * @Template()", + " */", + "public function $1Action($2)", + "{", + "\t$6", + "\\}" + ] + }, + "redir": { + "prefix": "redir", + "description": "Symfony2 redirect", + "body": "\\$this->redirect(\\$this->generateUrl('$1', $2));" + }, + "usecontroller": { + "prefix": "usecontroller", + "description": "Symfony2 use Symfony\\..\\Controller", + "body": "use Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller;$1" + }, + "usereauest": { + "prefix": "usereauest", + "description": "Symfony2 use Symfony\\..\\Request", + "body": "use Symfony\\Component\\HttpFoundation\\Request;$1" + }, + "useroute": { + "prefix": "useroute", + "description": "Symfony2 use Sensio\\..\\Route", + "body": "use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Route;$1" + }, + "useresponse": { + "prefix": "useresponse", + "description": "Symfony2 use Symfony\\..\\Response", + "body": "use Symfony\\Component\\HttpFoundation\\Response;$1" + }, + "usefile": { + "prefix": "usefile", + "description": "Symfony2 use Symfony\\..\\File", + "body": "use Symfony\\Component\\HttpFoundation\\File\\UploadedFile;$1" + }, + "useassert": { + "prefix": "useassert", + "description": "Symfony2 use Symfony\\..\\Constraints as Assert", + "body": "use Symfony\\Component\\Validator\\Constraints as Assert;$1" + }, + "usetemplate": { + "prefix": "usetemplate", + "description": "Symfony2 use Sensio\\..\\Template", + "body": "use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template;$1" + }, + "usecache": { + "prefix": "usecache", + "description": "Symfony2 use Sensio\\..\\Cache", + "body": "use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Cache;$1" + }, + "usemethod": { + "prefix": "usemethod", + "description": "Symfony2 use Sensio\\..\\Method", + "body": "use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Method;$1" + }, + "usearray": { + "prefix": "usearray", + "description": "Symfony2 use Doctrine\\..\\ArrayCollection", + "body": "use Doctrine\\Common\\Collections\\ArrayCollection;$1" + }, + "useorm": { + "prefix": "useorm", + "description": "Symfony2 use Doctrine\\..\\Mapping as ORM", + "body": "use Doctrine\\ORM\\Mapping as ORM;$1" + }, + "usesecure": { + "prefix": "usesecure", + "description": "Symfony2 use JMS\\..\\Secure", + "body": "use JMS\\SecurityExtraBundle\\Annotation\\Secure;$1" + } +} diff --git a/luasnip_snippets/php.json b/luasnip_snippets/php.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/php.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/plsql.json b/luasnip_snippets/plsql.json new file mode 100644 index 0000000..7512358 --- /dev/null +++ b/luasnip_snippets/plsql.json @@ -0,0 +1,511 @@ +{ + "doc": { + "prefix": "doc", + "description": "Document comment", + "body": [ + "\t/*", + "\t *\t${0: comment ...}", + "\t */" + ] + }, + "pkggbl": { + "prefix": "pkggbl", + "description": "Package Global variables", + "body": [ + " -- Declare Global Variables", + " g_sysdate\t\t\t\t\t\t\t\t\tDATE := SYSDATE;", + " g_delimiter\t\t\t\t\t\t\t\t\tVARCHAR2( 30 ) := '\t ';", + " g_err_length_limit\t\t\t\t\t\tNUMBER := 1500;", + " g_package_name\t\t\t\t\t CONSTANT VARCHAR2(30) := '$0';", + " g_proc_name VARCHAR2(100)\t\t\t\t\t:= NULL;", + " excp_custom\t\t\t\t\t\t\t\t\tEXCEPTION;", + "", + " -- Declare User Global Types", + "" + ] + }, + "flushca": { + "prefix": "flushca", + "description": "Flush Cache", + "body": "ALTER SYSTEM FLUSH BUFFER_CACHE;" + }, + "flushsp": { + "prefix": "flushsp", + "description": "Flush Shared Pool", + "body": "ALTER SYSTEM FLUSH SHARED_POOL;" + }, + "err": { + "prefix": "err", + "body": "\tshow errors;" + }, + "sel": { + "prefix": "sel", + "description": "Select statement", + "body": "SELECT ${0:*} FROM $1 WHERE 1 = 1;" + }, + "selc": { + "prefix": "selc", + "description": "Select statement", + "body": "SELECT COUNT(1) FROM $1 WHERE $0;" + }, + "wrn": { + "prefix": "wrn", + "description": "Where ROWNNUM", + "body": "WHERE ROWNUM <= 10 ${0:AND}" + }, + "arn": { + "prefix": "arn", + "description": "AND ROWNNUM", + "body": "AND ROWNUM <= 10 ${0:;}" + }, + "dbo": { + "prefix": "dbo", + "description": "Show output ", + "body": "\tDBMS_OUTPUT.put_line('$0');" + }, + "dbl": { + "prefix": "dbl", + "description": "Log message in Log Table, Change procedure as defined by you", + "body": "\tDEBUG_LOG_PKG.WRITE_LOG(${1:'Test'},${2:$1} ,$0 );" + }, + "dut": { + "prefix": "dut", + "description": "DBMS_OUTPUT.put_line", + "body": "\tDBMS_UTILITY.get_time;" + }, + "bc": { + "prefix": "bc", + "description": "Bulk collect into", + "body": "\tbulk collect into $0" + }, + "ei": { + "prefix": "ei", + "description": "Execute Immediate", + "body": "\tEXECUTE IMMEDIATE '${0:statement}' ;" + }, + "eitt": { + "prefix": "eitt", + "description": "Execute Immediate TRUNCATE Table", + "body": "\tEXECUTE IMMEDIATE( 'TRUNCATE TABLE ${0:table}');" + }, + "eitp": { + "prefix": "eitp", + "description": "Execute Immediate ALTER Table Truncate partition", + "body": "\tEXECUTE IMMEDIATE( 'ALTER TABLE ${1:table} TRUNCATE PARTITION ${0:partition}');" + }, + "prmpt": { + "prefix": "prmpt", + "description": "Prompt message", + "body": "PROMPT ${1:Creating }..." + }, + "crseq": { + "prefix": "crseq", + "description": "Create Sequence", + "body": [ + "DROP SEQUENCE ${1:schema}.${2:name}_s;", + "", + "CREATE SEQUENCE $1.$2_s", + " START WITH ${3:1}", + " MAXVALUE 999999999999999999999999999", + " MINVALUE 1", + " NOCYCLE", + " NOCACHE", + " NOORDER;" + ] + }, + "crsyn": { + "prefix": "crsyn", + "description": "Create Synonym", + "body": [ + "", + "CREATE OR REPLACE SYNONYM ${1:schema}.${2:name} FOR ${3:target}.$0;", + "" + ] + }, + "crind": { + "prefix": "crind", + "description": "Create Index", + "body": [ + "DROP INDEX $1.$4;", + "", + "CREATE INDEX $1.${4:$2_$5}", + "ON ${1:schema}.${2:table}($3) ${6:TABLESPACE $0 };" + ] + }, + "drtab": { + "prefix": "drtab", + "description": "Drop Table", + "body": [ + "DROP TABLE ${1:schema}.${2:name} CASCADE CONSTRAINTS ${3:PURGE};", + "" + ] + }, + "crtab": { + "prefix": "crtab", + "description": "Create Table", + "body": [ + "", + "DROP TABLE ${1:schema}.${2:name} CASCADE CONSTRAINTS PURGE;", + "", + "CREATE TABLE $1.$2", + "(", + " $0", + ")", + "${3:TABLESPACE $4}", + ";" + ] + }, + "ccol": { + "prefix": "ccol", + "description": "Add VARCHAR2 column to table", + "body": "\t${1:,} ${2:name}\tVARCHAR2(${0:100})" + }, + "dcol": { + "prefix": "dcol", + "description": "Add DATE column to table", + "body": "\t${1:,} ${0:name}\tDATE" + }, + "ncol": { + "prefix": "ncol", + "description": "Add NUMBER column to table", + "body": "\t${1:,} ${0:name}\tNUMBER" + }, + "at": { + "prefix": "at", + "description": "Alter Table", + "body": "\tALTER TABLE ${1:table} $0" + }, + "tr": { + "prefix": "tr", + "description": "Type record", + "body": "\tTYPE t_${1:rec} IS RECORD (${0:/* columns */} );" + }, + "tt": { + "prefix": "tt", + "description": "Type Table", + "body": "\tTYPE t_${1:tbl} IS TABLE OF ${0:table_name}%ROWTYPE INDEX BY BINARY_INTEGER;" + }, + "tc": { + "prefix": "tc", + "description": "Type Cursor", + "body": "\tTYPE t_${1:tbl} IS TABLE OF ${0:cur}%ROWTYPE INDEX BY BINARY_INTEGER;" + }, + "pn": { + "prefix": "pn", + "body": "\tp_$1\t\t${2:IN}\t\tNUMBER ${3:DEFAULT ${0:NULL}}" + }, + "pd": { + "prefix": "pd", + "body": "\tp_$1\t\t${2:IN}\t\tDATE ${3:DEFAULT ${0:SYSDATE}}" + }, + "pc": { + "prefix": "pc", + "body": "\tP_$1\t\t${2:IN}\t\tVARCHAR2 ${3:DEFAULT ${0:NULL}}" + }, + "ln": { + "prefix": "ln", + "body": "\tl_$1\t\tNUMBER ${2: := $3 };" + }, + "ld": { + "prefix": "ld", + "body": "\tl_$1\t\tDATE ${2: := $3 };" + }, + "lc": { + "prefix": "lc", + "body": "\tl_$1\t\tVARCHAR2(${2:100}) ${3: := $4 };" + }, + "gn": { + "prefix": "gn", + "body": "\tg_$1\t\tNUMBER ${2: := ${3:10} };" + }, + "gd": { + "prefix": "gd", + "body": "\tg_$1\t\tDATE ${2: := ${3:SYSDATE} };" + }, + "gc": { + "prefix": "gc", + "body": "\tg_$1\t\tVARCHAR2(${2:100}) ${3: := $4 };" + }, + "ltbl": { + "prefix": "ltbl", + "body": "\tl_tbl_$1\t\t$0;" + }, + "lrec": { + "prefix": "lrec", + "body": "\tl_rec_$1\t\t$0;" + }, + "if": { + "prefix": "if", + "description": "If Condition", + "body": [ + "\tIF($1) THEN", + "\t\t$0;", + "\tEND IF;" + ] + }, + "ife": { + "prefix": "ife", + "description": "IF-Else Condition", + "body": [ + "\tIF($1) THEN", + "\t\t$2;", + "\tELSIF", + "\t\t$0;", + "\tEND IF;" + ] + }, + "els": { + "prefix": "els", + "description": "Else Condition", + "body": [ + "\tELSIF ${1:condition} THEN", + "\t\t$0;" + ] + }, + "case": { + "prefix": "case", + "description": "Case statement", + "body": [ + "\tCASE WHEN ($1) THEN", + "\t\t$2", + "\tWHEN ($3) THEN", + "\t\t$4", + "\t${0:ELSE}", + "\tEND " + ] + }, + "while": { + "prefix": "while", + "description": "While Loop", + "body": [ + "\tWHILE ${1:a} ${2:condition} ${3:b}\tLOOP", + "\t\t$0;", + "\tEND LOOP;" + ] + }, + "fori": { + "prefix": "fori", + "description": "For Loop", + "body": [ + "\tFOR ${1:indx} in ${2:1}..${3:10} LOOP", + "\t\t$4;", + "\tEND LOOP;" + ] + }, + "fort": { + "prefix": "fort", + "description": "Table For Loop", + "body": [ + "\tFOR ${1:indx} in 1..${2:ttb}.count LOOP", + "\t\t$0;", + "\tEND LOOP;" + ] + }, + "loop": { + "prefix": "loop", + "description": "Loop statement", + "body": [ + "\tLOOP", + "\t\t$0;", + "\tEND LOOP;" + ] + }, + "fora": { + "prefix": "fora", + "description": "For All Loop", + "body": [ + "\t IF ( ${1:ttbl}.COUNT > 0 ) THEN", + "\t\t BEGIN", + "\t\t\tFORALL ${2:indx} IN 1 .. $1.COUNT", + "\t\t\t\t-- Insert/Update", + "\t\t\t\t$0", + "\t\t EXCEPTION --Exception Block", + "\t\t\tWHEN OTHERS THEN", + "\t\t\t l_errmsg\t := 'Error while Bulk updating, Error : ' || SQLERRM;", + "\t\t\t RAISE excp_custom;", + "\t\t END;", + "\t END IF;" + ] + }, + "forc": { + "prefix": "forc", + "description": "For Cursor Loop", + "body": [ + "\tFOR $1_rec IN ${1:cur} ${2:(${3:param})}", + "\tLOOP", + "\t\t$0", + "\tEND LOOP; -- End $1" + ] + }, + "dcur": { + "prefix": "dcur", + "description": "Cursor declaration", + "body": [ + "\tCURSOR ${1:cur} IS", + "\tSELECT $0", + "\t\tFROM $1", + "\t\tWHERE 1 = 1;" + ] + }, + "copen": { + "prefix": "copen", + "description": "Open Cursor", + "body": [ + "\tOPEN ${1:cursor} ${2:( ${3:param} )};", + "\tFETCH $1", + "\tINTO ${4:record};", + "\t$0", + "\tIF ( $1 %NOTFOUND ) THEN", + "\t\tCLOSE $1;", + "\t\tl_errmsg := 'No records fetched in cursor : $1.';", + "\t\tRAISE excp_custom;", + "\tEND IF;", + "\tCLOSE $1;" + ] + }, + "copenbc": { + "prefix": "copenbc", + "description": "Open Cursor Bulk collect", + "body": [ + "\tOPEN ${1:cursor} ${2:( ${3:param} )};", + "\tFETCH $1", + "\tBULK COLLECT INTO ${4:ttbl};", + "\tCLOSE $1;", + "", + "\tIF ( $4.count = 0 ) THEN", + "\t\tl_errmsg := 'No records fetched in cursor : $1.';", + "\t\tRAISE excp_custom;{0\\}", + "\tEND IF;" + ] + }, + "decl": { + "prefix": "decl", + "description": "Declare Begin block", + "body": [ + "DECLARE", + "\t$1", + "BEGIN\t ", + "\t${0:null}", + "EXCEPTION --Exception Block\t ", + " WHEN NO_DATA_FOUND THEN", + "\t\tdbms_output.put_line('No Data Found');", + " WHEN OTHERS THEN", + "\t dbms_output.put_line('Error while . Error : '||sqlerrm);", + "END;" + ] + }, + "begin": { + "prefix": "begin", + "description": "Begin block", + "body": [ + "BEGIN\t ", + " $0", + "EXCEPTION --Exception Block\t ", + " WHEN NO_DATA_FOUND THEN", + "\t printlog('No Data Found');", + " WHEN OTHERS THEN", + "\t printlog('Error while . Error : '||sqlerrm);", + "END;" + ] + }, + "excp": { + "prefix": "excp", + "description": "Exception Block", + "body": [ + "\tEXCEPTION --Exception Block", + "\t$0", + "\t\tWHEN OTHERS THEN", + "\t\t$1;", + "\tEND;" + ] + }, + "rae": { + "prefix": "rae", + "description": "Raise Application Error", + "body": "RAISE_APPLICATION_ERROR(${1:-20000},${0:''});" + }, + "crjob": { + "prefix": "crjob", + "description": "Submit DBMS Job", + "body": [ + "-- Submit the job to get the output", + "BEGIN", + "\tDECLARE", + "\t\tvjob\t\t INTEGER;", + "\tBEGIN", + "\t\tDBMS_JOB.submit( vjob, '${1:procedure}${0:('''')};', SYSDATE );", + "\t\tDBMS_OUTPUT.put_line( 'Job id : ' || vjob );", + "\t\tCOMMIT;", + "\tEND;", + "END;" + ] + }, + "whilejob": { + "prefix": "whilejob", + "description": "Submit DBMS Job with While Loop", + "body": [ + "-- Submit the job to get the output", + "", + "BEGIN", + "\tDECLARE", + "\t\tvjob\t\t INTEGER;", + "\tBEGIN", + "\t\tDBMS_JOB.submit ( vjob , '", + "DECLARE", + "\tl_start_date\t\t DATE := ''${1:01-Jan-2017}'';", + "BEGIN", + "\tWHILE l_start_date < ''${2:01-Jan-2017}''", + "\tLOOP", + "\t\t${3:Procedure}${0:( to_char(l_start_date,''YYYYMMDD'') )};", + "\t\tl_start_date\t\t := TRUNC( l_start_date + 1 );", + "\tEND LOOP;", + "EXCEPTION --Exception Block", + "\tWHEN OTHERS THEN", + "\t\tDBMS_OUTPUT.put_line( ''Error while . Error : '' || SQLERRM );", + "END;", + "\t\t\t'", + "\t\t , SYSDATE", + "\t\t);", + "\t\tDBMS_OUTPUT.put_line( 'Job id : ' || vjob );", + "\t\tCOMMIT;", + "\tEND;", + "END;" + ] + }, + "crprintlog": { + "prefix": "crprintlog", + "description": "Create Printlog Procedure", + "body": [ + "\t------------------------------------------------------------------------------------------------", + "\t-- PROCEDURE\t: PRINTLOG", + "\t-- Description\t: This procedure is used to print log messages in Log file, Table and Console", + "\t------------------------------------------------------------------------------------------------", + "\tPROCEDURE printlog (p_message IN VARCHAR2)", + "\tIS", + "\t\tl_errmsg\t\t\t\t\t\t\t\t\t VARCHAR2 (10000);", + "\tBEGIN", + "\t\tl_errmsg := SUBSTR ( p_message, 1, g_err_length_limit);", + "\t\tfnd_file.put_line ( fnd_file.LOG, l_errmsg); -- Debug log file", + "\t\tDBMS_OUTPUT.put_line (l_errmsg); -- Console output", + "\t\tDEBUG_LOG_PKG.WRITE_LOG(g_package_name,g_proc_name,p_message); -- Debug table", + "\tEND printlog;" + ] + }, + "crgeterr": { + "prefix": "crgeterr", + "description": "Create get_errmsg function", + "body": [ + " -- Form the error message for when others", + " FUNCTION get_errmsg( p_message IN VARCHAR2 DEFAULT NULL )", + "\t RETURN VARCHAR2", + " IS", + " BEGIN", + "\t RETURN 'Error occured in ' || g_package_name || '.' || g_proc_name || '. ' || NVL( p_message, '' ) || ' Error : ' || SQLERRM;", + " EXCEPTION --Exception Block", + "\t WHEN OTHERS THEN", + "\t\t printlog( 'Error while forming messgage. Error : ' || SQLERRM );", + "\t\t RETURN NULL;", + " END;" + ] + } +} diff --git a/luasnip_snippets/proto.json b/luasnip_snippets/proto.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/proto.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/puppet.json b/luasnip_snippets/puppet.json new file mode 100644 index 0000000..59af56d --- /dev/null +++ b/luasnip_snippets/puppet.json @@ -0,0 +1,215 @@ +{ + "lambda": { + "prefix": "lambda", + "description": "Lambda function chain-called on a variable", + "body": [ + "\\$${1:varname}.${2:each} |${3:Type} \\$${4:param}| {", + "\t$0", + "\\}" + ] + }, + "cron": { + "prefix": "cron", + "description": "Cron resource type", + "body": [ + "cron { '${1:name}':", + "\tuser => ${2:user},", + "\tcommand => '${3:command}',", + "\tminute => ${3:minute},", + "\thour => ${4:hour},", + "\\}" + ] + }, + "exec": { + "prefix": "exec", + "description": "Exec resource type", + "body": [ + "exec { '${1:command}':", + "\tcommand => \"${2:$1}\",", + "\tuser => \"${3:root}\",", + "\\}" + ] + }, + "file": { + "prefix": "file", + "description": "File resource type", + "body": [ + "file { '${1:name}':", + "\tsource => \"puppet://${2:path}\",", + "\tmode => ${3:mode},", + "\\}" + ] + }, + "File": { + "prefix": "File", + "description": "Defaults for file", + "body": [ + "File {", + "\towner => ${1:username},", + "\tgroup => ${2:groupname},", + "\\}" + ] + }, + "group": { + "prefix": "group", + "description": "Group resource type", + "body": [ + "group { '${1:groupname}':", + "\tensure => ${3:present},", + "\tgid => ${2:gid},", + "\\}" + ] + }, + "mount": { + "prefix": "mount", + "description": "Mount resource type", + "body": [ + "mount { '${1:path}':", + "\tdevice => '${2:/dev}',", + "\tfstype => '${3:filesystem}',", + "\tensure => mounted,", + "\toptions => 'rw,errors=remount-ro',", + "\\}" + ] + }, + "package": { + "prefix": "package", + "description": "Package resource type", + "body": [ + "package { '${1:name}':", + "\tensure => ${2:installed},", + "\\}" + ] + }, + "user": { + "prefix": "user", + "description": "user resource type", + "body": [ + "user { '${1:username}':", + "\tensure => ${2:present},", + "\tuid => ${3:uid},", + "\tgid => ${4:gid},", + "\tcomment => ${5:gecos},", + "\thome => ${6:homedirectory},", + "\tmanagehome => false,", + "\trequire => Group['${7:group'}],", + "\\}" + ] + }, + "service": { + "prefix": "service", + "description": "Service resource type", + "body": [ + "service { '${1:name}':", + "\thasstatus => true,", + "\tenable => true,", + "\tensure => running,", + "\\}" + ] + }, + "alert": { + "prefix": "alert", + "description": "Alert Function", + "body": "alert(\"${1:message}\")$0" + }, + "crit": { + "prefix": "crit", + "description": "Crit Function", + "body": "crit(\"${1:message}\")$0" + }, + "debug": { + "prefix": "debug", + "description": "Debug Function", + "body": "debug(\"${1:message}\")$0" + }, + "defined": { + "prefix": "defined", + "description": "Defined Function", + "body": "defined(${1:Resource}[\"${2:name}\"])$0" + }, + "emerg": { + "prefix": "emerg", + "description": "Emerg Function", + "body": "emerg(\"${1:message}\")$0" + }, + "extlookup": { + "prefix": "extlookup", + "description": "Extlookup with defaults and custom data file", + "body": "\\$${1:Variable} = extlookup(\"${2:Lookup}\", ${3:Default}, ${4:Data Source})$0" + }, + "fail": { + "prefix": "fail", + "description": "Fail Function", + "body": "fail(\"${1:message}\")$0" + }, + "hiera": { + "prefix": "hiera", + "description": "Hiera with defaults and override", + "body": "\\$${1:Variable} = hiera(\"${2:Lookup}\", ${3:Default}, ${4:Override})$0" + }, + "hiera_hash": { + "prefix": "hiera_hash", + "description": "Hiera Hash with defaults and override", + "body": "\\$${1:Variable} = hiera_hash(\"${2:Lookup}\", ${3:Default}, ${4:Override})$0" + }, + "hiera_include": { + "prefix": "hiera_include", + "description": "Hiera Include Function", + "body": "hiera_include(\"${1:Lookup}\")$0" + }, + "lookup": { + "prefix": "lookup", + "description": "Lookup data from hiera", + "body": "\\$${1:varname} = lookup('${2:hiera::key}')$0" + }, + "trocla": { + "prefix": "trocla", + "description": "Lookup or generate sensitive information", + "body": "trocla('${1:lookup_key}', '${2:plain}', ${3:'length: 32'})$0" + }, + "include": { + "prefix": "include", + "description": "Include Function", + "body": "include ${1:classname}$0" + }, + "info": { + "prefix": "info", + "description": "Info Function", + "body": "info(\"${1:message}\")$0" + }, + "inline_template": { + "prefix": "inline_template", + "description": "Inline Template Function", + "body": "inline_template(\"<%= ${1:template} %>\")$0" + }, + "notice": { + "prefix": "notice", + "description": "Notice Function", + "body": "notice(\"${1:message}\")$0" + }, + "realize": { + "prefix": "realize", + "description": "Realize Function", + "body": "realize(${1:Resource}[\"${2:name}\"])$0" + }, + "regsubst": { + "prefix": "regsubst", + "description": "Regsubst Function", + "body": "regsubst(\\$${1:Target}, '${2:regexp}', '${3:replacement}')$0" + }, + "split": { + "prefix": "split", + "description": "Split Function", + "body": "\\$${1:Variable} = split(\\$${1:Target}, '${2:regexp}')$0" + }, + "versioncmp": { + "prefix": "versioncmp", + "description": "Version Compare Function", + "body": "\\$${1:Variable} = versioncmp('${1:version}', '${2:version}')$0" + }, + "warning": { + "prefix": "warning", + "description": "Warning Function", + "body": "warning(\"${1:message}\")$0" + } +} diff --git a/luasnip_snippets/python.json b/luasnip_snippets/python.json new file mode 100644 index 0000000..094b6fa --- /dev/null +++ b/luasnip_snippets/python.json @@ -0,0 +1,260 @@ +{ + "#!": { + "prefix": "#!", + "description": "#!/usr/bin/env python", + "body": [ + "#!/usr/bin/env python", + "$0" + ], + "luasnip": { + "priority": -50 + } + }, + "#!2": { + "prefix": "#!2", + "description": "#!/usr/bin/env python2", + "body": [ + "#!/usr/bin/env python2", + "# -*- coding: utf-8 -*-", + "$0" + ] + }, + "#!3": { + "prefix": "#!3", + "description": "#!/usr/bin/env python3", + "body": [ + "#!/usr/bin/env python3", + "$0" + ] + }, + "contain": { + "prefix": "contain", + "description": "methods for emulating a container type", + "body": [ + "def __len__(self):", + "\t${1:pass}", + "", + "def __getitem__(self, key):", + "\t${2:pass}", + "", + "def __setitem__(self, key, value):", + "\t${3:pass}", + "", + "def __delitem__(self, key):", + "\t${4:pass}", + "", + "def __iter__(self):", + "\t${5:pass}", + "", + "def __reversed__(self):", + "\t${6:pass}", + "", + "def __contains__(self, item):", + "\t${7:pass}" + ] + }, + "context": { + "prefix": "context", + "description": "context manager methods", + "body": [ + "def __enter__(self):", + "\t${1:pass}", + "", + "def __exit__(self, exc_type, exc_value, traceback):", + "\t${2:pass}" + ] + }, + "attr": { + "prefix": "attr", + "description": "methods for customizing attribute access", + "body": [ + "def __getattr__(self, name):", + "\t${1:pass}", + "", + "def __setattr__(self, name, value):", + "\t${2:pass}", + "", + "def __delattr__(self, name):", + "\t${3:pass}" + ] + }, + "desc": { + "prefix": "desc", + "description": "methods implementing descriptors", + "body": [ + "def __get__(self, instance, owner):", + "\t${1:pass}", + "", + "def __set__(self, instance, value):", + "\t${2:pass}", + "", + "def __delete__(self, instance):", + "\t${3:pass}" + ] + }, + "cmp": { + "prefix": "cmp", + "description": "methods implementing rich comparison", + "body": [ + "def __eq__(self, other):", + "\t${1:pass}", + "", + "def __ne__(self, other):", + "\t${2:pass}", + "", + "def __lt__(self, other):", + "\t${3:pass}", + "", + "def __le__(self, other):", + "\t${4:pass}", + "", + "def __gt__(self, other):", + "\t${5:pass}", + "", + "def __ge__(self, other):", + "\t${6:pass}", + "", + "def __cmp__(self, other):", + "\t${7:pass}" + ] + }, + "repr": { + "prefix": "repr", + "description": "methods implementing string representation", + "body": [ + "def __repr__(self):", + "\t${1:pass}", + "", + "def __str__(self):", + "\t${2:pass}", + "", + "def __unicode__(self):", + "\t${3:pass}" + ] + }, + "numeric": { + "prefix": "numeric", + "description": "methods for emulating a numeric type", + "body": [ + "def __add__(self, other):", + "\t${1:pass}", + "", + "def __sub__(self, other):", + "\t${2:pass}", + "", + "def __mul__(self, other):", + "\t${3:pass}", + "", + "def __div__(self, other):", + "\t${4:pass}", + "", + "def __truediv__(self, other):", + "\t${5:pass}", + "", + "def __floordiv__(self, other):", + "\t${6:pass}", + "", + "", + "def __mod__(self, other):", + "\t${7:pass}", + "", + "def __divmod__(self, other):", + "\t${8:pass}", + "", + "def __pow__(self, other):", + "\t${9:pass}", + "", + "", + "def __lshift__(self, other):", + "\t${10:pass}", + "", + "def __rshift__(self, other):", + "\t${11:pass}", + "", + "def __and__(self, other):", + "\t${12:pass}", + "", + "def __xor__(self, other):", + "\t${13:pass}", + "", + "def __or__(self, other):", + "\t${14:pass}", + "", + "", + "def __neg__(self):", + "\t${15:pass}", + "", + "def __pos__(self):", + "\t${16:pass}", + "", + "def __abs__(self):", + "\t${17:pass}", + "", + "def __invert__(self):", + "\t${18:pass}", + "", + "", + "def __complex__(self):", + "\t${19:pass}", + "", + "def __int__(self):", + "\t${20:pass}", + "", + "def __long__(self):", + "\t${21:pass}", + "", + "def __float__(self):", + "\t${22:pass}", + "", + "", + "def __oct__(self):", + "\t${22:pass}", + "", + "def __hex__(self):", + "\t${23:pass}", + "", + "", + "def __index__(self):", + "\t${24:pass}", + "", + "def __coerce__(self, other):", + "\t${25:pass}" + ] + }, + "from": { + "prefix": "from", + "description": "from module import name", + "body": "from ${1:module} import ${2:Stuff}" + }, + "roprop": { + "prefix": "roprop", + "description": "Read Only Property", + "body": [ + "@property", + "def ${1:name}(self):", + "\t${2:return self._$1}$0" + ] + }, + "match": { + "prefix": "match", + "description": "Structural pattern matching", + "body": [ + "match ${1:expression}:", + "\tcase ${2:pattern_1}:", + "\t\t${3:pass}", + "\tcase ${4:pattern_2}:", + "\t\t${0:pass}" + ] + }, + "matchw": { + "prefix": "matchw", + "description": "Pattern matching with wildcard", + "body": [ + "match ${1:expression}:", + "\tcase ${2:pattern_1}:", + "\t\t${3:pass}", + "\tcase _:", + "\t\t${0:pass}" + ] + } +} diff --git a/luasnip_snippets/r.json b/luasnip_snippets/r.json new file mode 100644 index 0000000..9514078 --- /dev/null +++ b/luasnip_snippets/r.json @@ -0,0 +1,57 @@ +{ + "#!": { + "prefix": "#!", + "description": "#!/usr/bin/env Rscript", + "body": [ + "#!/usr/bin/env Rscript", + "$0" + ], + "luasnip": { + "priority": -20 + } + }, + "df": { + "prefix": "df", + "description": "Data frame", + "body": "${1:name}[${2:rows}, ${0:cols}]" + }, + "fis": { + "prefix": "fis", + "description": "Fisher test", + "body": "fisher.test(${1:x}, ${0:y})" + }, + "chi": { + "prefix": "chi", + "description": "Chi Squared test", + "body": "chisq.test(${1:x}, ${0:y})" + }, + "tt": { + "prefix": "tt", + "description": "t-test", + "body": "t.test(${1:x}, ${0:y})" + }, + "wil": { + "prefix": "wil", + "description": "Wilcox test", + "body": "wilcox.test(${1:x}, ${0:y})" + }, + "cor": { + "prefix": "cor", + "description": "Correlation test", + "body": "cor.test(${1:x}, ${0:y})" + }, + "fte": { + "prefix": "fte", + "description": "FTE test", + "body": "var.test(${1:x}, ${0:y})" + }, + "kvt": { + "prefix": "kvt", + "description": "KV test", + "body": "kv.test(${1:x}, ${0:y})" + }, + "vec": { + "prefix": "vec", + "body": "${1:var} <- c(\"${0:\\${VISUAL:/ /\",\"/g\\}}\")" + } +} diff --git a/luasnip_snippets/rails.json b/luasnip_snippets/rails.json new file mode 100644 index 0000000..e1b37ab --- /dev/null +++ b/luasnip_snippets/rails.json @@ -0,0 +1,886 @@ +{ + "anaf": { + "prefix": "anaf", + "description": "accepts_nested_attributes_for", + "body": [ + "accepts_nested_attributes_for :${1:association_name}\\${2:${3:, allow_destroy: true}${4:, reject_if: proc { |obj| ${5:obj.blank?} \\}\\}}", + "" + ], + "luasnip": { + "priority": -50 + } + }, + "tcbi": { + "prefix": "tcbi", + "description": "Create binary column", + "body": [ + "t.binary :${1:title}${2:, limit: ${3:2}.megabytes}", + "$0" + ] + }, + "tcb": { + "prefix": "tcb", + "description": "Create boolean column", + "body": [ + "t.boolean :${1:title}", + "$0" + ] + }, + "clac": { + "prefix": "clac", + "description": "Create controller class", + "body": [ + "class ${1:Model}Controller < ApplicationController", + "\tbefore_action :find_${2:model}", + "", + "\t$0", + "", + "\tprivate", + "\tdef find_$2", + "\t\t@$2 = ${3:$1}.find(params[:id]) if params[:id]", + "\tend", + "end" + ] + }, + "tcda": { + "prefix": "tcda", + "description": "Create date column", + "body": [ + "t.date :${1:title}", + "$0" + ] + }, + "tcdt": { + "prefix": "tcdt", + "description": "Create datetime column", + "body": [ + "t.datetime :${1:title}", + "$0" + ] + }, + "tcd": { + "prefix": "tcd", + "description": "Create decimal column", + "body": [ + "t.decimal :${1:title}${2:${3:, precision: ${4:10}}${5:, scale: ${6:2}}}", + "$0" + ] + }, + "tcf": { + "prefix": "tcf", + "description": "Create float column", + "body": [ + "t.float :${1:title}", + "$0" + ] + }, + "clact": { + "prefix": "clact", + "description": "Create functional test class", + "body": [ + "require 'test_helper'", + "", + "class ${1:Model}ControllerTest < ActionController::TestCase", + "\ttest$0", + "end", + "" + ] + }, + "tci": { + "prefix": "tci", + "description": "Create integer column", + "body": [ + "t.integer :${1:title}", + "$0" + ] + }, + "tcl": { + "prefix": "tcl", + "description": "Create lock_version column", + "body": [ + "t.integer :lock_version, null: false, default: 0", + "$0" + ] + }, + "tcr": { + "prefix": "tcr", + "description": "Create references column", + "body": [ + "t.references :${1:taggable}${2:, polymorphic: ${3:{ default: '${4:Photo}' \\}}}", + "$0" + ] + }, + "tcs": { + "prefix": "tcs", + "description": "Create string column", + "body": [ + "t.string :${1:title}", + "$0" + ] + }, + "tct": { + "prefix": "tct", + "description": "Create text column", + "body": [ + "t.text :${1:title}", + "$0" + ] + }, + "tcti": { + "prefix": "tcti", + "description": "Create time column", + "body": [ + "t.time :${1:title}", + "$0" + ] + }, + "tcts": { + "prefix": "tcts", + "description": "Create timestamp column", + "body": [ + "t.timestamp :${1:title}", + "$0" + ] + }, + "tctss": { + "prefix": "tctss", + "description": "Create timestamps columns", + "body": [ + "t.timestamps", + "$0" + ] + }, + "mccc": { + "prefix": "mccc", + "description": "Migration Create Column Continue (mccc)", + "body": [ + "t.column ${1:title}, :${2:string}", + "mccc$0" + ] + }, + "mtab": { + "prefix": "mtab", + "description": "Migration Drop Create Table (mdct)", + "body": "drop_table :${1:table}${2: [press tab twice to generate create_table]}" + }, + "mcol": { + "prefix": "mcol", + "description": "Migration Remove and Add Column (mrac)", + "body": "remove_column :${1:table}, :${2:column}${3: [press tab twice to generate add_column]}" + }, + "rdb": { + "prefix": "rdb", + "description": "RAILS_DEFAULT_LOGGER.debug (rdb)", + "body": "RAILS_DEFAULT_LOGGER.debug \"${1:message}\"$0" + }, + "tre": { + "prefix": "tre", + "description": "Table column(s) rename", + "body": [ + "t.rename(:${1:old_column_name}, :${2:new_column_name})", + "$0" + ] + }, + "art": { + "prefix": "art", + "description": "Test Assert Redirected To (art)", + "body": "assert_redirected_to ${2:action: \"${1:index}\"}" + }, + "asre": { + "prefix": "asre", + "description": "Test Assert Response (are)", + "body": "assert_response :${1:success}, @response.body$0" + }, + "aftc": { + "prefix": "aftc", + "description": "after_create", + "body": "after_create $0" + }, + "aftd": { + "prefix": "aftd", + "description": "after_destroy", + "body": "after_destroy $0" + }, + "afts": { + "prefix": "afts", + "description": "after_save", + "body": "after_save $0" + }, + "aftu": { + "prefix": "aftu", + "description": "after_update", + "body": "after_update $0" + }, + "aftv": { + "prefix": "aftv", + "description": "after_validation", + "body": "after_validation $0" + }, + "aftvoc": { + "prefix": "aftvoc", + "description": "after_validation_on_create", + "body": "after_validation_on_create $0" + }, + "aftvou": { + "prefix": "aftvou", + "description": "after_validation_on_update", + "body": "after_validation_on_update $0" + }, + "asg": { + "prefix": "asg", + "description": "assert(var = assigns(:var))", + "body": [ + "assert(${1:var} = assigns(:$1), \"Cannot find @$1\")", + "$0" + ] + }, + "asd": { + "prefix": "asd", + "description": "assert_difference", + "body": [ + "assert_difference \"${1:Model}.${2:count}\", ${3:1} do", + "\t$0", + "end" + ] + }, + "asnd": { + "prefix": "asnd", + "description": "assert_no_difference", + "body": [ + "assert_no_difference \"${1:Model}.${2:count}\" do", + "\t$0", + "end" + ] + }, + "artnpp": { + "prefix": "artnpp", + "description": "assert_redirected_to (nested path plural)", + "body": "assert_redirected_to ${10:${2:parent}_${3:child}_path(${4:@}${5:$2})}" + }, + "artnp": { + "prefix": "artnp", + "description": "assert_redirected_to (nested path)", + "body": "assert_redirected_to ${2:${12:parent}_${13:child}_path(${14:@}${15:$12}, ${16:@}${17:$13})}" + }, + "artpp": { + "prefix": "artpp", + "description": "assert_redirected_to (path plural)", + "body": "assert_redirected_to ${10:${2:model}s_path}" + }, + "artp": { + "prefix": "artp", + "description": "assert_redirected_to (path)", + "body": "assert_redirected_to ${2:${12:model}_path(${13:@}${14:$12})}" + }, + "asrj": { + "prefix": "asrj", + "description": "assert_rjs", + "body": "assert_rjs :${1:replace}, ${2:\"${3:dom id}\"}" + }, + "ass": { + "prefix": "ass", + "description": "assert_select", + "body": [ + "assert_select '${1:path}'${2:, ${3:text}: ${4:'${5:inner_html}'}}${6: do", + "\t$0", + "end}" + ] + }, + "befc": { + "prefix": "befc", + "description": "before_create", + "body": "before_create $0" + }, + "befd": { + "prefix": "befd", + "description": "before_destroy", + "body": "before_destroy $0" + }, + "befs": { + "prefix": "befs", + "description": "before_save", + "body": "before_save $0" + }, + "befu": { + "prefix": "befu", + "description": "before_update", + "body": "before_update $0" + }, + "befv": { + "prefix": "befv", + "description": "before_validation", + "body": "before_validation $0" + }, + "befvoc": { + "prefix": "befvoc", + "description": "before_validation_on_create", + "body": "before_validation_on_create $0" + }, + "befvou": { + "prefix": "befvou", + "description": "before_validation_on_update", + "body": "before_validation_on_update" + }, + "crw": { + "prefix": "crw", + "description": "cattr_accessor", + "body": "cattr_accessor :${0:attr_names}" + }, + "test": { + "prefix": "test", + "description": "test do..end", + "body": [ + "test \"${1:something interesting}\" do", + "\t$0", + "end" + ] + }, + "deftg": { + "prefix": "deftg", + "description": "def get request", + "body": [ + "def test_should_get_${1:action}", + "\t${2:@${3:model} = ${4:$3s}(:${5:fixture_name})", + "\t}get :$1${6:, id: @$3.to_param}", + "\tassert_response :success", + "\t$0", + "end" + ] + }, + "deftp": { + "prefix": "deftp", + "description": "def post request", + "body": [ + "def test_should_post_${1:action}", + "\t${3:@$2 = ${4:$2s}(:${5:fixture_name})", + "\t}post :$1${6:, id: @$2.to_param}, ${2:model}: { $0 \\}", + "\tassert_response :redirect", + "", + "end" + ] + }, + "fina": { + "prefix": "fina", + "description": "find(:all)", + "body": "find(:all${1:, conditions: ['${2:${3:field} = ?}', ${5:true}]})" + }, + "finf": { + "prefix": "finf", + "description": "find(:first)", + "body": "find(:first${1:, conditions: ['${2:${3:field} = ?}', ${5:true}]})" + }, + "fini": { + "prefix": "fini", + "description": "find(id)", + "body": "find(${1:id})" + }, + "fine": { + "prefix": "fine", + "description": "find_each", + "body": [ + "find_each(\\${1conditions: {:${2:field}: ${3:true}\\}\\}) do |${4:\\${TM_CURRENT_WORD/(\\w+)\\./\\L$1/g\\}}|", + "\t$0", + "end" + ] + }, + "finb": { + "prefix": "finb", + "description": "find_in_batches", + "body": [ + "find_in_batches(\\${1conditions: {:${2:field}: ${3:true}\\}\\}) do |${4:\\${TM_CURRENT_WORD/(\\w+)\\./\\L$1/g\\}}s|", + "\t$4s.each do |$4|", + "\t\t$0", + "\tend", + "end" + ] + }, + "habtm": { + "prefix": "habtm", + "description": "has_and_belongs_to_many (habtm)", + "body": "has_and_belongs_to_many :${1:object}${2:, join_table: \"${3:table_name}\", foreign_key: \"${4:$1_id}\"}" + }, + "hm": { + "prefix": "hm", + "description": "has_many (hm)", + "body": "has_many :${1:object}s${2:, class_name: \"$1\", foreign_key: \"${4:reference}_id\"}" + }, + "hmt": { + "prefix": "hmt", + "description": "has_many (through)", + "body": "has_many :${1:objects}, through: :${2:join_association}${3:, source: :${4:$2_table_foreign_key_to_$1_table}}" + }, + "hmd": { + "prefix": "hmd", + "description": "has_many dependent: :destroy", + "body": "has_many :${1:object}s${2:, class_name: \"$1\", foreign_key: \"${4:reference}_id\"}, dependent: :destroy$0" + }, + "logd": { + "prefix": "logd", + "description": "logger.debug", + "body": "${1:Rails.}logger.debug { \"${1:message}\" \\}$0" + }, + "loge": { + "prefix": "loge", + "description": "logger.error", + "body": "logger.error { \"${1:message}\" \\}$0" + }, + "logf": { + "prefix": "logf", + "description": "logger.fatal", + "body": "logger.fatal { \"${1:message}\" \\}$0" + }, + "logi": { + "prefix": "logi", + "description": "logger.info", + "body": "logger.info { \"${1:message}\" \\}$0" + }, + "logw": { + "prefix": "logw", + "description": "logger.warn", + "body": "logger.warn { \"${1:message}\" \\}$0" + }, + "mp": { + "prefix": "mp", + "description": "map(&:sym_proc)", + "body": "map(&:${1:id})" + }, + "mapca": { + "prefix": "mapca", + "description": "map.catch_all", + "body": [ + "${1:map}.catch_all \"*${2:anything}\", controller: \"${3:default}\", action: \"${4:error}\"", + "" + ] + }, + "map": { + "prefix": "map", + "description": "map.named_route", + "body": "${1:map}.${2:connect} '${3::controller/:action/:id}'" + }, + "mapr": { + "prefix": "mapr", + "description": "map.resource", + "body": [ + "${1:map}.resource :${2:resource}${10: do |${11:$2}|", + "\t$0", + "end}" + ] + }, + "maprs": { + "prefix": "maprs", + "description": "map.resources", + "body": [ + "${1:map}.resources :${2:resource}${10: do |${11:$2}|", + "\t$0", + "end}" + ] + }, + "mapwo": { + "prefix": "mapwo", + "description": "map.with_options", + "body": [ + "\\${1map\\}.with_options :${2:controller}: '${3:thing}' do |${4:$3}|", + "\t$0", + "end", + "" + ] + }, + "mrw": { + "prefix": "mrw", + "description": "mattr_accessor", + "body": "mattr_accessor :${0:attr_names}" + }, + "ncl": { + "prefix": "ncl", + "description": "named_scope lambda", + "body": [ + "named_scope :name, lambda { |\\${1param\\}| { :conditions: ${3:['${4:${5:field} = ?}', ${6:$1}]} \\} \\}", + "" + ] + }, + "nc": { + "prefix": "nc", + "description": "named_scope", + "body": [ + "named_scope :name${1:, joins: :${2:table}}, conditions: ${3:['${4:${5:field} = ?}', ${6:true}]}", + "" + ] + }, + "dscope": { + "prefix": "dscope", + "description": "default_scope", + "body": "default_scope ${1:order(${2:'${3:created_at DESC}'})}" + }, + "flash": { + "prefix": "flash", + "description": "flash[...]", + "body": "flash[:${1:notice}] = \"${2:Successfully created...}\"$0" + }, + "rea": { + "prefix": "rea", + "description": "redirect_to (action)", + "body": "redirect_to action: \"${1:index}\"" + }, + "reai": { + "prefix": "reai", + "description": "redirect_to (action, id)", + "body": "redirect_to action: \"${1:show}\", id: ${0:@item}" + }, + "rec": { + "prefix": "rec", + "description": "redirect_to (controller)", + "body": "redirect_to controller: \"${1:items}\"" + }, + "reca": { + "prefix": "reca", + "description": "redirect_to (controller, action)", + "body": "redirect_to controller: \"${1:items}\", action: \"${2:list}\"" + }, + "recai": { + "prefix": "recai", + "description": "redirect_to (controller, action, id)", + "body": "redirect_to controller: \"${1:items}\", action: \"${2:show}\", id: ${0:@item}" + }, + "renpp": { + "prefix": "renpp", + "description": "redirect_to (nested path plural)", + "body": "redirect_to(${2:${10:parent}_${11:child}_path(${12:@}${13:$10})})" + }, + "renp": { + "prefix": "renp", + "description": "redirect_to (nested path)", + "body": "redirect_to(${2:${12:parent}_${13:child}_path(${14:@}${15:$12}, ${16:@}${17:$13})})" + }, + "repp": { + "prefix": "repp", + "description": "redirect_to (path plural)", + "body": "redirect_to(${2:${10:model}s_path})" + }, + "rep": { + "prefix": "rep", + "description": "redirect_to (path)", + "body": "redirect_to(${2:${12:model}_path(${13:@}${14:$12})})" + }, + "reb": { + "prefix": "reb", + "description": "redirect_to :back", + "body": "redirect_to :back" + }, + "ra": { + "prefix": "ra", + "description": "render (action)... (ra)", + "body": "render action: \"${1:action}\"" + }, + "ral": { + "prefix": "ral", + "description": "render (action,layout) (ral)", + "body": "render action: \"${1:action}\", layout: \"${2:layoutname}\"" + }, + "rf": { + "prefix": "rf", + "description": "render (file) (rf)", + "body": "render file: \"${1:filepath}\"" + }, + "rfu": { + "prefix": "rfu", + "description": "render (file,use_full_path) (rfu)", + "body": "render file: \"${1:filepath}\", use_full_path: ${2:false}" + }, + "ri": { + "prefix": "ri", + "description": "render (inline) (ri)", + "body": "render inline: \"${1:<%= 'hello' %>}\"" + }, + "ril": { + "prefix": "ril", + "description": "render (inline,locals) (ril)", + "body": "render inline: \"${1:<%= 'hello' %>}\", locals { ${2::name}: \"${3:value}\"$4 \\}" + }, + "rit": { + "prefix": "rit", + "description": "render (inline,type) (rit)", + "body": "render inline: \"${1:<%= 'hello' %>}\", type: ${2::rjson}" + }, + "rl": { + "prefix": "rl", + "description": "render (layout) (rl)", + "body": "render layout: \"${1:layoutname}\"" + }, + "rn": { + "prefix": "rn", + "description": "render (nothing) (rn)", + "body": "render nothing: ${1:true}" + }, + "rns": { + "prefix": "rns", + "description": "render (nothing,status) (rns)", + "body": "render nothing: ${1:true}, status: ${2:401}" + }, + "rt": { + "prefix": "rt", + "description": "render (text) (rt)", + "body": "render text: \"${1:text to render...}\"" + }, + "rtl": { + "prefix": "rtl", + "description": "render (text,layout) (rtl)", + "body": "render text: \"${1:text to render...}\", layout: \"${2:layoutname}\"" + }, + "rtlt": { + "prefix": "rtlt", + "description": "render (text,layout => true) (rtlt)", + "body": "render text: \"${1:text to render...}\", layout: ${2:true}" + }, + "rts": { + "prefix": "rts", + "description": "render (text,status) (rts)", + "body": "render text: \"${1:text to render...}\", status: ${2:401}" + }, + "ru": { + "prefix": "ru", + "description": "render (update)", + "body": [ + "render :update do |${2:page}|", + "\t$2.$0", + "end" + ] + }, + "rest": { + "prefix": "rest", + "description": "respond_to", + "body": [ + "respond_to do |wants|", + "\twants.${1:html}${2: { $0 \\}}", + "end" + ] + }, + "t.": { + "prefix": "t.", + "description": "t.timestamps (tctss)", + "body": [ + "t.timestamps", + "t.$0" + ] + }, + "vaoif": { + "prefix": "vaoif", + "description": "validates_acceptance_of if", + "body": "validates_acceptance_of :${1:terms}${2:${3:, accept: \"${4:1}\"}${5:, message: \"${6:You must accept the terms of service}\"}}, if: proc { |obj| ${7:obj.condition?} \\}\\}" + }, + "vao": { + "prefix": "vao", + "description": "validates_acceptance_of", + "body": "validates :${1:terms}${2:, acceptance: ${3:{ accept: \"${4:1}\"${5:, message: \"${6:You must accept the terms of service}\"}\\}} }" + }, + "va": { + "prefix": "va", + "description": "validates_associated (va)", + "body": "validates_associated :${1:attribute}${2:, on: :${3:create}}" + }, + "vaif": { + "prefix": "vaif", + "description": "validates_associated if (vaif)", + "body": "validates_associated :${1:attribute}${2:, on: :${3:create}, if: proc { |obj| ${5:obj.condition?} \\}}" + }, + "vc": { + "prefix": "vc", + "description": "validates_confirmation_of (vc)", + "body": "validates_confirmation_of :${1:attribute}${2:, on: :${3:create}, message: \"${4:should match confirmation}\"}" + }, + "vcif": { + "prefix": "vcif", + "description": "validates_confirmation_of if (vcif)", + "body": "validates_confirmation_of :${1:attribute}${2:, on: :${3:create}, message: \"${4:should match confirmation}\", if: proc { |obj| ${5:obj.condition?} \\}}" + }, + "ve": { + "prefix": "ve", + "description": "validates_exclusion_of (ve)", + "body": "validates_exclusion_of :${1:attribute}${2:, in: ${3:%w( ${4:mov avi} )}, on: :${5:create}, message: \"${6:extension %s is not allowed}\"}" + }, + "veif": { + "prefix": "veif", + "description": "validates_exclusion_of if (veif)", + "body": "validates_exclusion_of :${1:attribute}${2:, in: ${3:%w( ${4:mov avi} )}, on: :${5:create}, message: \"${6:extension %s is not allowed}\"}, if: proc { |obj| ${7:obj.condition?} \\}\\}" + }, + "vfif": { + "prefix": "vfif", + "description": "validates_format_of if", + "body": "validates_format_of :${1:attribute}, with: /${2:^[${3:\\w\\d}]+\\$}/${4:, on: :${5:create}, message: \"${6:is invalid}\"}, if: proc { |obj| ${7:obj.condition?} \\}\\}" + }, + "vf": { + "prefix": "vf", + "description": "validates_format_of", + "body": "validates_format_of :${1:attribute}, with: /${2:^[${3:\\w\\d}]+\\$}/${4:, on: :${5:create}, message: \"${6:is invalid}\"}" + }, + "viif": { + "prefix": "viif", + "description": "validates_inclusion_of if", + "body": "validates_inclusion_of :${1:attribute}${2:, in: ${3:%w( ${4:mov avi} )}, on: :${5:create}, message: \"${6:extension %s is not included in the list}\"}, if: proc { |obj| ${7:obj.condition?} \\}\\}" + }, + "vi": { + "prefix": "vi", + "description": "validates_inclusion_of", + "body": "validates_inclusion_of :${1:attribute}${2:, in: ${3:%w( ${4:mov avi} )}, on: :${5:create}, message: \"${6:extension %s is not included in the list}\"}" + }, + "vl": { + "prefix": "vl", + "description": "validates_length_of (vl)", + "body": "validates_length_of :${1:attribute}, within: ${2:3..20}${3:, on: :${4:create}, message: \"${5:must be present}\"}" + }, + "vlif": { + "prefix": "vlif", + "description": "validates_length_of if", + "body": "validates_length_of :${1:attribute}, within: ${2:3..20}${3:, on: :${4:create}, message: \"${5:must be present}\"}, if: proc { |obj| ${6:obj.condition?} \\}\\}" + }, + "vnif": { + "prefix": "vnif", + "description": "validates_numericality_of if", + "body": "validates_numericality_of :${1:attribute}${2:, on: :${3:create}, message: \"${4:is not a number}\"}, if: proc { |obj| ${5:obj.condition?} \\}\\}" + }, + "vn": { + "prefix": "vn", + "description": "validates_numericality_of", + "body": "validates_numericality_of :${1:attribute}${2:, on: :${3:create}, message: \"${4:is not a number}\"}" + }, + "vp": { + "prefix": "vp", + "description": "validates_presence_of (vp)", + "body": "validates_presence_of :${1:attribute}${2:, on: :${3:create}, message: \"${4:can't be blank}\"}" + }, + "vpif": { + "prefix": "vpif", + "description": "validates_presence_of if (vpif) 2", + "body": "validates_presence_of :${1:attribute}${2:, on: :${3:create}, message: \"${4:can't be blank}\"}, if: proc { |obj| ${5:obj.condition?} \\}\\}" + }, + "vu": { + "prefix": "vu", + "description": "validates_uniqueness_of (vu)", + "body": "validates_uniqueness_of :${1:attribute}${2:, on: :${3:create}, message: \"${4:must be unique}\"}" + }, + "vuif": { + "prefix": "vuif", + "description": "validates_uniqueness_of if (vuif)", + "body": "validates_uniqueness_of :${1:attribute}${2:, on: :${3:create}, message: \"${4:must be unique}\", if: proc { |obj| ${6:obj.condition?} \\}}" + }, + "verify": { + "prefix": "verify", + "description": "verify -- redirect", + "body": [ + "verify only: [:$1], session: :user, params: :id, redirect_to {:action: '${2:index}'\\}", + "" + ] + }, + "wants": { + "prefix": "wants", + "description": "wants_format", + "body": "wants.${1:js|json|html}${2: { $0 \\}}" + }, + "xdelete": { + "prefix": "xdelete", + "description": "xhr delete", + "body": "xhr :delete, :${1:destroy}, id: ${2:1}$0" + }, + "xget": { + "prefix": "xget", + "description": "xhr get", + "body": "xhr :get, :${1:show}${2:, id: ${3:1}}$0" + }, + "xpost": { + "prefix": "xpost", + "description": "xhr post", + "body": "xhr :post, :${1:create}, ${2:object}: { $3 \\}" + }, + "xput": { + "prefix": "xput", + "description": "xhr put", + "body": "xhr :put, :${1:update}, id: ${2:1}, ${3:object}: { $4 \\}$0" + }, + "col": { + "prefix": "col", + "description": "collection routes", + "body": [ + "collection do", + "\t${1:get :${2:action}}", + "\t${3:put :${4:action}}", + "\t${5:post :${6:action}}", + "\t${7:delete :${8:action}}", + "end" + ] + }, + "format": { + "prefix": "format", + "description": "format (respond_with)", + "body": "format.${1:html|xml|json|js|any} { $0 \\}" + }, + "gem": { + "prefix": "gem", + "description": "gem", + "body": "gem '${1:name}'${2:${3:, \"${4:1.0}\"}${5:${6:, require: ${7:\"${8:$1}\"}}${9:, group: :${10:test}}}}" + }, + "gemg": { + "prefix": "gemg", + "description": "gem :git", + "body": "gem '${1:paperclip}', git: \"${2:git://github.com/thoughtbot/paperclip.git}\"${3:, branch: \"${4:rails3}\"}" + }, + "match": { + "prefix": "match", + "description": "match", + "body": "match '${1:${2::controller}${3:/${4::action}${5:/${6::id}${7:(.:format)}}}}'${8: '${9:$2}#${10:$4}'${11:, as: :${12:$10}}}" + }, + "member": { + "prefix": "member", + "description": "member routes", + "body": [ + "member do", + "\t${1:get :${2:action}}", + "\t${3:put :${4:action}}", + "\t${5:post :${6:action}}", + "\t${7:delete :${8:action}}", + "end" + ] + }, + "res": { + "prefix": "res", + "description": "resources", + "body": [ + "resources :${1:posts}${2: do", + "\t$3", + "end}" + ] + }, + "scope": { + "prefix": "scope", + "description": "scope", + "body": "scope :${1:name}, { ${2:joins(:${3:table}).}where(${4:'${5:$3.${6:field}} = ?', ${7:'${8:value}'}}) \\}" + }, + "scopel": { + "prefix": "scopel", + "description": "scope lambda", + "body": "scope :${1:name}, lambda { |${2:param}| ${3:where(${4::${5:field}: ${6:\"${7:value}\"}})} \\}" + }, + "scopee": { + "prefix": "scopee", + "description": "scope with extension", + "body": [ + "scope :${1:name}, { ${2:where(${3::${4:field}: ${5:'${6:value}'}})} \\} do", + "\tdef ${7:method_name}", + "\t\t$0", + "\tend", + "end" + ] + }, + "sb": { + "prefix": "sb", + "description": "scoped_by", + "body": "scoped_by_${1:attribute}(${2:id})" + }, + "setup": { + "prefix": "setup", + "description": "setup do..end", + "body": [ + "setup do", + "\t$0", + "end" + ] + } +} diff --git a/luasnip_snippets/rnoweb.json b/luasnip_snippets/rnoweb.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/rnoweb.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/robot.json b/luasnip_snippets/robot.json new file mode 100644 index 0000000..b8e77f1 --- /dev/null +++ b/luasnip_snippets/robot.json @@ -0,0 +1,395 @@ +{ + "cat": { + "prefix": "cat", + "description": "Catenate", + "body": "\\${${1:name}\\}= Catenate SEPARATOR=${2:---} ${3:Hello} ${4:world}", + "luasnip": { + "priority": -50 + } + }, + "eval": { + "prefix": "eval", + "description": "Evaluate", + "body": "\\${${1:val}\\}= Evaluate ${2:\\${x\\} - 10}" + }, + "nop": { + "prefix": "nop", + "description": "No Operation", + "body": "No Operation" + }, + "rfk": { + "prefix": "rfk", + "description": "Return From Keyword", + "body": "Return From Keyword ${1:\\${optional return value\\}}" + }, + "rfki": { + "prefix": "rfki", + "description": "Return From Keyword If", + "body": "Return From Keyword If '\\${${1:rc}\\}' != '${2:abc}' ${3:\\${optional return value\\}}" + }, + "rk": { + "prefix": "rk", + "description": "Run Keyword", + "body": "Run Keyword ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkacof": { + "prefix": "rkacof", + "description": "Run Keyword And Continue On Failure", + "body": "Run Keyword And Continue On Failure ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkaee": { + "prefix": "rkaee", + "description": "Run Keyword And Expect Error", + "body": "Run Keyword And Expect Error ${1:My error} ${2:\\${kw\\}} ${3:\\${args\\}}" + }, + "rkaie": { + "prefix": "rkaie", + "description": "Run Keyword And Ignore Error", + "body": [ + "Run Keyword And Ignore Error ${1:\\${kw\\}} ${2:\\${args\\}}", + "\\${${3:result}\\} \\${${4:return_value}\\}= Run Keyword And Ignore Error ${1:\\${kw\\}} ${2:\\${args\\}}" + ] + }, + "rkar": { + "prefix": "rkar", + "description": "Run Keyword And Return", + "body": "Run Keyword And Return ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkari": { + "prefix": "rkari", + "description": "Run Keyword And Return If", + "body": "Run Keyword And Return If '\\${${1:rc}\\}' != '${2:abc}' ${3:\\${kw\\}} ${4:\\${args\\}}" + }, + "rkars": { + "prefix": "rkars", + "description": "Run Keyword And Return Status", + "body": "\\${${3:result}\\}= Run Keyword And Return Status ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkiactf": { + "prefix": "rkiactf", + "description": "Run Keyword If Any Critical Tests Failed", + "body": "Run Keyword If Any Critical Tests Failed ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkiactp": { + "prefix": "rkiactp", + "description": "Run Keyword If All Critical Tests Passed", + "body": "Run Keyword If All Critical Tests Passed ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkiatf": { + "prefix": "rkiatf", + "description": "Run Keyword If Any Tests Failed", + "body": "Run Keyword If Any Tests Failed ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkiatp": { + "prefix": "rkiatp", + "description": "Run Keyword If All Tests Passed", + "body": "Run Keyword If All Tests Passed ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkitf": { + "prefix": "rkitf", + "description": "Run Keyword If Test Failed", + "body": "Run Keyword If Test Failed ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkitp": { + "prefix": "rkitp", + "description": "Run Keyword If Test Passed", + "body": "Run Keyword If Test Passed ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rkito": { + "prefix": "rkito", + "description": "Run Keyword If Timeout Occurred", + "body": "Run Keyword If Timeout Occurred ${1:\\${kw\\}} ${2:\\${args\\}}" + }, + "rku": { + "prefix": "rku", + "description": "Run Keyword Unless", + "body": "Run Keyword Unless '\\${${1:rc}\\}' != '${2:abc}' ${3:\\${kw\\}} ${4:\\${args\\}}" + }, + "sgv": { + "prefix": "sgv", + "description": "Set Global Variable", + "body": "Set Global Variable \\${${1:name}\\} ${2:\\${value\\}}" + }, + "sbe": { + "prefix": "sbe", + "description": "Should Be Equal", + "body": "Should Be Equal \"\\${${1:var}\\}\" \"${2:expected value}\" ${3:\"optional error msg\"}\t${4:ignore_case=True}" + }, + "sleep": { + "prefix": "sleep", + "description": "Sleep", + "body": "Sleep ${1:2 minutes 10 seconds}" + }, + "ssv": { + "prefix": "ssv", + "description": "Set Suite Variable", + "body": "Set Suite Variable \\${${1:name}\\} ${2:\\${value\\}}" + }, + "stv": { + "prefix": "stv", + "description": "Set Test Variable", + "body": "Set Test Variable \\${${1:name}\\} ${2:\\${value\\}}" + }, + "sv": { + "prefix": "sv", + "description": "Set Variable", + "body": "\\${${1:name}\\}= Set Variable ${2:\\${value\\}}" + }, + "pause": { + "prefix": "pause", + "description": "Pause test execution", + "body": [ + "Import library Dialogs", + "Pause execution" + ] + }, + "tpause": { + "prefix": "tpause", + "description": "Teardown Pause - pause test execution only on failure", + "body": [ + "[Teardown] Run Keyword If Test Failed Run Keywords", + "... Import library Dialogs AND", + "... Pause execution" + ] + }, + "cps": { + "prefix": "cps", + "description": "Capture Page Screenshot", + "body": "Capture Page Screenshot ${1:\\${optional filename\\}}" + }, + "esbd": { + "prefix": "esbd", + "description": "Element Should Be Disabled", + "body": "Element Should Be Disabled \\${${1:locator}\\}" + }, + "esbe": { + "prefix": "esbe", + "description": "Element Should Be Enabled", + "body": "Element Should Be Enabled \\${${1:locator}\\}" + }, + "esbf": { + "prefix": "esbf", + "description": "Element Should Be Focused", + "body": "Element Should Be Focused \\${${1:locator}\\}" + }, + "esbv": { + "prefix": "esbv", + "description": "Element Should Be Visible", + "body": "Element Should Be Visible \\${${1:locator}\\} ${2:\\${optional message\\}}" + }, + "esc": { + "prefix": "esc", + "description": "Element Should Contain", + "body": "Element Should Contain \\${${1:locator}\\} ${2:\\${expected\\}} ${3:\\${optional message\\}}" + }, + "esnbv": { + "prefix": "esnbv", + "description": "Element Should Not Be Visible", + "body": "Element Should Not Be Visible \\${${1:locator}\\} ${2:\\${optional message\\}}" + }, + "esnc": { + "prefix": "esnc", + "description": "Element Should Not Contain", + "body": "Element Should Not Contain \\${${1:locator}\\} ${2:\\${expected\\}} ${3:\\${optional message\\}}" + }, + "etsb": { + "prefix": "etsb", + "description": "Element Text Should Be", + "body": "Element Text Should Be \\${${1:locator}\\} ${2:\\${expected\\}} ${3:\\${optional message\\}}" + }, + "eaj": { + "prefix": "eaj", + "description": "Execute Async Javascript", + "body": "Execute Async Javascript ${1:\\${code line 1\\}} ${2:\\${code line 2\\}}" + }, + "ej": { + "prefix": "ej", + "description": "Execute Javascript", + "body": "Execute Javascript ${1:\\${code line 1\\}} ${2:\\${code line 2\\}}" + }, + "gwp": { + "prefix": "gwp", + "description": "Get Window Position", + "body": "\\${${1:x}\\} \\${${2:y}\\}= Get Window Position" + }, + "gws": { + "prefix": "gws", + "description": "Get Window Size", + "body": "\\${${1:width}\\} \\${${2:height}\\}= Get Window Size" + }, + "mbw": { + "prefix": "mbw", + "description": "Maximize Browser Window", + "body": "Maximize Browser Window" + }, + "md": { + "prefix": "md", + "description": "Mouse Down", + "body": "Mouse Down \\${${1:locator}\\}" + }, + "mdoi": { + "prefix": "mdoi", + "description": "Mouse Down On Image", + "body": "Mouse Down On Image ${1:\\${locator\\}}" + }, + "mdol": { + "prefix": "mdol", + "description": "Mouse Down On Link", + "body": "Mouse Down On Link ${1:\\${locator\\}}" + }, + "mout": { + "prefix": "mout", + "description": "Mouse Out", + "body": "Mouse Out ${1:\\${locator\\}}" + }, + "mover": { + "prefix": "mover", + "description": "Mouse Over", + "body": "Mouse Over ${1:\\${locator\\}}" + }, + "mu": { + "prefix": "mu", + "description": "Mouse Up", + "body": "Mouse Up ${1:\\${locator\\}}" + }, + "ob": { + "prefix": "ob", + "description": "Open Browser", + "body": "Open Browser ${1:\\${url\\}} ${2:\\${browser=firefox\\}} ${3:\\${alias=None\\}} ${4:\\${remote_url=False\\}} ${5:\\${desired_capabilities=None\\}} ${6:\\${ff_profile_dir=None\\}}" + }, + "ocm": { + "prefix": "ocm", + "description": "Open Context Menu", + "body": "Open Context Menu ${1:\\${locator\\}}" + }, + "psc": { + "prefix": "psc", + "description": "Page Should Contain", + "body": "Page Should Contain ${1:\\${text\\}} ${2:loglevel=INFO}" + }, + "pscb": { + "prefix": "pscb", + "description": "Page Should Contain Button", + "body": "Page Should Contain Button ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "pscc": { + "prefix": "pscc", + "description": "Page Should Contain Checkbox", + "body": "Page Should Contain Checkbox ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psce": { + "prefix": "psce", + "description": "Page Should Contain Element", + "body": "Page Should Contain Element ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psci": { + "prefix": "psci", + "description": "Page Should Contain Image", + "body": "Page Should Contain Image ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "pscl": { + "prefix": "pscl", + "description": "Page Should Contain Link", + "body": "Page Should Contain Link ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "pscrb": { + "prefix": "pscrb", + "description": "Page Should Contain Radio Button", + "body": "Page Should Contain Radio Button ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psct": { + "prefix": "psct", + "description": "Page Should Contain Textfield", + "body": "Page Should Contain Textfield ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psnc": { + "prefix": "psnc", + "description": "Page Should Not Contain", + "body": "Page Should Not Contain ${1:\\${text\\}} ${2:loglevel=INFO}" + }, + "psncb": { + "prefix": "psncb", + "description": "Page Should Not Contain Button", + "body": "Page Should Not Contain Button ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psncc": { + "prefix": "psncc", + "description": "Page Should Not Contain Checkbox", + "body": "Page Should Not Contain Checkbox ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psnce": { + "prefix": "psnce", + "description": "Page Should Not Contain Element", + "body": "Page Should Not Contain Element ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psnci": { + "prefix": "psnci", + "description": "Page Should Not Contain Image", + "body": "Page Should Not Contain Image ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psncl": { + "prefix": "psncl", + "description": "Page Should Not Contain Link", + "body": "Page Should Not Contain Link ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psncrb": { + "prefix": "psncrb", + "description": "Page Should Not Contain Radio Button", + "body": "Page Should Not Contain Radio Button ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "psnct": { + "prefix": "psnct", + "description": "Page Should Not Contain Textfield", + "body": "Page Should Not Contain Textfield ${1:\\${locator\\}} ${2:\\${message=\\}} ${3:loglevel=INFO}" + }, + "rktrof": { + "prefix": "rktrof", + "description": "Register Keyword To Run On Failure", + "body": "Register Keyword To Run On Failure ${1:\\${kw\\}}" + }, + "wuec": { + "prefix": "wuec", + "description": "Wait Until Element Contains", + "body": "Wait Until Element Contains ${1:\\${locator\\}} ${2:\\${text\\}} ${3:\\${timeout=None\\}} ${4:\\${error=None\\}}" + }, + "wuednc": { + "prefix": "wuednc", + "description": "Wait Until Element Does Not Contain", + "body": "Wait Until Element Does Not Contain ${1:\\${locator\\}} ${2:\\${text\\}} ${3:\\${timeout=None\\}} ${4:\\${error=None\\}}" + }, + "wueie": { + "prefix": "wueie", + "description": "Wait Until Element Is Enabled", + "body": "Wait Until Element Is Enabled ${1:\\${locator\\}} ${2:\\${timeout=None\\}} ${3:\\${error=None\\}}" + }, + "wueinv": { + "prefix": "wueinv", + "description": "Wait Until Element Is Not Visible", + "body": "Wait Until Element Is Not Visible ${1:\\${locator\\}} ${2:\\${timeout=None\\}} ${3:\\${error=None\\}}" + }, + "wueiv": { + "prefix": "wueiv", + "description": "Wait Until Element Is Visible", + "body": "Wait Until Element Is Visible ${1:\\${locator\\}} ${2:\\${timeout=None\\}} ${3:\\${error=None\\}}" + }, + "wupc": { + "prefix": "wupc", + "description": "Wait Until Page Contains", + "body": "Wait Until Page Contains ${1:\\${text\\}} ${2:\\${timeout=None\\}} ${3:\\${error=None\\}}" + }, + "wupce": { + "prefix": "wupce", + "description": "Wait Until Page Contains Element", + "body": "Wait Until Page Contains Element ${1:\\${locator\\}} ${2:\\${timeout=None\\}} ${3:\\${error=None\\}}" + }, + "wupdnc": { + "prefix": "wupdnc", + "description": "Wait Until Page Does Not Contain", + "body": "Wait Until Page Does Not Contain ${1:\\${text\\}} ${2:\\${timeout=None\\}} ${3:\\${error=None\\}}" + }, + "wupdnce": { + "prefix": "wupdnce", + "description": "Wait Until Page Does Not Contain Element", + "body": "Wait Until Page Does Not Contain Element ${1:\\${locator\\}} ${2:\\${timeout=None\\}} ${3:\\${error=None\\}}" + } +} diff --git a/luasnip_snippets/rst.json b/luasnip_snippets/rst.json new file mode 100644 index 0000000..2d91acd --- /dev/null +++ b/luasnip_snippets/rst.json @@ -0,0 +1,11 @@ +{ + "fnt": { + "prefix": "fnt", + "description": "Footnote or Citation", + "body": [ + "[${1:Label}]_ $0", + "", + ".. [$1] ${2:Reference}" + ] + } +} diff --git a/luasnip_snippets/ruby.json b/luasnip_snippets/ruby.json new file mode 100644 index 0000000..6c24630 --- /dev/null +++ b/luasnip_snippets/ruby.json @@ -0,0 +1,111 @@ +{ + "#!": { + "prefix": "#!", + "description": "#!/usr/bin/env ruby", + "body": [ + "#!/usr/bin/env ruby", + "$0" + ], + "luasnip": { + "priority": -50 + } + }, + "defr": { + "prefix": "defr", + "description": "def <name> ... rescue ...", + "body": [ + "def ${1:function_name}${2:(${3:*args})}", + "\t$4", + "rescue", + "\t$0", + "end" + ] + }, + "For": { + "prefix": "For", + "description": "(<from>..<to>).each { |<i>| <block> }", + "body": "(${1:from}..${2:to}).each { |${3:i}| $0 \\}" + }, + "until": { + "prefix": "until", + "description": "until <expression> ... end", + "body": [ + "until ${1:expression}", + "\t$0", + "end" + ] + }, + "Until": { + "prefix": "Until", + "description": "begin ... end until <expression>", + "body": [ + "begin", + "\t$0", + "end until ${1:expression}" + ] + }, + "while": { + "prefix": "while", + "description": "while <expression> ... end", + "body": [ + "while ${1:expression}", + "\t$0", + "end" + ] + }, + "While": { + "prefix": "While", + "description": "begin ... end while <expression>", + "body": [ + "begin", + "\t$0", + "end while ${1:expression}" + ] + }, + "begin": { + "prefix": "begin", + "description": "begin ... rescue ... end", + "body": [ + "begin", + "\t$1", + "rescue", + "\t$0", + "end" + ] + }, + "rescue": { + "prefix": "rescue", + "body": [ + "rescue Exception => e", + "\tputs e.message", + "\tputs e.backtrace.inspect", + "\t${0:# Rescue}" + ] + }, + "###": { + "prefix": "###", + "body": [ + "=begin", + "\t$0", + "=end" + ] + }, + "priv": { + "prefix": "priv", + "description": "private ", + "body": [ + "private", + "", + "$0" + ] + }, + "prot": { + "prefix": "prot", + "description": "protected", + "body": [ + "protected", + "", + "$0" + ] + } +} diff --git a/luasnip_snippets/rust.json b/luasnip_snippets/rust.json new file mode 100644 index 0000000..dc2d111 --- /dev/null +++ b/luasnip_snippets/rust.json @@ -0,0 +1,16 @@ +{ + ".it": { + "prefix": ".it", + "description": ".iter()", + "body": ".iter()$0" + }, + "impl": { + "prefix": "impl", + "description": "Struct/Trait implementation", + "body": [ + "impl$4 ${1:Type/Trait}${2: for ${3:Type}}${4:<${5:T}>} {", + "\t$0", + "\\}" + ] + } +} diff --git a/luasnip_snippets/sh.json b/luasnip_snippets/sh.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/sh.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/snippets.json b/luasnip_snippets/snippets.json new file mode 100644 index 0000000..fe06430 --- /dev/null +++ b/luasnip_snippets/snippets.json @@ -0,0 +1,7 @@ +{ + "vis": { + "prefix": "vis", + "description": "${VISUAL}", + "body": "\\${VISUAL${1:${2:default}${3:/transform/}}\\}" + } +} diff --git a/luasnip_snippets/soy.json b/luasnip_snippets/soy.json new file mode 100644 index 0000000..2298166 --- /dev/null +++ b/luasnip_snippets/soy.json @@ -0,0 +1,79 @@ +{ + "ns": { + "prefix": "ns", + "description": "Namespace", + "body": "{namespace ${1:name}\\}", + "luasnip": { + "priority": -50 + } + }, + "msg": { + "prefix": "msg", + "description": "Message", + "body": [ + "{msg desc=\"${1:description}\"\\}", + "\t$0", + "{/msg\\}" + ] + }, + "let": { + "prefix": "let", + "description": "let command", + "body": "{let \\$${1:identifier}: ${2:expression} /\\}" + }, + "if": { + "prefix": "if", + "description": "if .. (if)", + "body": [ + "{if ${1:expression}\\}", + "\t$0", + "{/if\\}" + ] + }, + "ife": { + "prefix": "ife", + "description": "if .. else (ife)", + "body": [ + "{if ${1:expression}\\}", + "\t$2", + "{else\\}", + "\t$0", + "{/if\\}" + ] + }, + "eli": { + "prefix": "eli", + "description": "else if .. (eli)", + "body": [ + "{elif ${1:expression}\\}", + "\t$0" + ] + }, + "fore": { + "prefix": "fore", + "description": "foreach command", + "body": [ + "{foreach \\$${1:var} in ${2:ref}\\}", + "\t$0", + "{/foreach\\}" + ] + }, + "for": { + "prefix": "for", + "description": "for command", + "body": [ + "{for \\$${1:var} in range(${2:rangeexpr})\\}", + "\t$0", + "{/for\\}" + ] + }, + "call": { + "prefix": "call", + "description": "template call", + "body": [ + "{call ${1:tmpl}\\}", + "\t$0", + "{/call\\}" + ] + } +} diff --git a/luasnip_snippets/supercollider.json b/luasnip_snippets/supercollider.json new file mode 100644 index 0000000..c059f42 --- /dev/null +++ b/luasnip_snippets/supercollider.json @@ -0,0 +1,18 @@ +{ + "for": { + "prefix": "for", + "body": [ + "for (${1:1}, ${2:10}) {${3: |i}|\\}", + "\t$0", + "\\}" + ] + }, + "sdef": { + "prefix": "sdef", + "body": [ + "SynthDef(\\${1:synthName}, {${2: |${3:x}|}", + "\t$0", + "\\}).add;" + ] + } +} diff --git a/luasnip_snippets/svelte.json b/luasnip_snippets/svelte.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/svelte.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/tcl.json b/luasnip_snippets/tcl.json new file mode 100644 index 0000000..f97bad5 --- /dev/null +++ b/luasnip_snippets/tcl.json @@ -0,0 +1,69 @@ +{ + "for": { + "prefix": "for", + "description": "for... (for)", + "body": [ + "for {${1:set i 0}\\} {${2:\\$i < \\$n}\\} {${3:incr i}\\} {", + "\t$4", + "\\}", + "" + ], + "luasnip": { + "priority": -50 + } + }, + "foreach": { + "prefix": "foreach", + "description": "foreach... (foreach)", + "body": [ + "foreach ${1:var} ${2:\\$list} {", + "\t$3", + "\\}", + "" + ] + }, + "if": { + "prefix": "if", + "description": "if... (if)", + "body": [ + "if {${1:condition}\\} {", + "\t$2", + "\\}", + "" + ] + }, + "proc": { + "prefix": "proc", + "description": "proc... (proc)", + "body": [ + "proc ${1:name} {${2:args}\\} \\", + "{", + "\t$3", + "\\}", + "" + ] + }, + "switch": { + "prefix": "switch", + "description": "switch... (switch)", + "body": [ + "switch ${1:-exact} -- ${2:\\$var} {", + "\t${3:match} {", + "\t\t$4", + "\t\\}", + "\tdefault {$5\\}", + "\\}", + "" + ] + }, + "while": { + "prefix": "while", + "description": "while... (while)", + "body": [ + "while {${1:condition}\\} {", + "\t$2", + "\\}", + "" + ] + } +} diff --git a/luasnip_snippets/tex.json b/luasnip_snippets/tex.json new file mode 100644 index 0000000..e82145e --- /dev/null +++ b/luasnip_snippets/tex.json @@ -0,0 +1,226 @@ +{ + "cc": { + "prefix": "cc", + "description": "subset", + "body": "\\subset " + }, + "inn": { + "prefix": "inn", + "description": "in ", + "body": "\\in " + }, + "Nn": { + "prefix": "Nn", + "description": "cap", + "body": "\\cap " + }, + "UU": { + "prefix": "UU", + "description": "cup", + "body": "\\cup " + }, + "uuu": { + "prefix": "uuu", + "description": "bigcup", + "body": "\\bigcup_{${1:i \\in ${2: I}}\\} $0" + }, + "nnn": { + "prefix": "nnn", + "description": "bigcap", + "body": "\\bigcap_{${1:i \\in ${2: I}}\\} $0" + }, + "HH": { + "prefix": "HH", + "description": "H", + "body": "\\mathbb{H\\}" + }, + "DD": { + "prefix": "DD", + "description": "D", + "body": "\\mathbb{D\\}" + }, + "inmath": { + "prefix": "inmath", + "description": "Inline Math", + "body": "\\($1\\) $0" + }, + "frac": { + "prefix": "frac", + "description": "Fraction", + "body": "\\frac{$1\\}{$2\\}$0" + }, + "compl": { + "prefix": "compl", + "description": "Complement", + "body": "^{c\\}" + }, + "ss": { + "prefix": "ss", + "description": "Super Script", + "body": "^{$1\\}$0" + }, + "__": { + "prefix": "__", + "description": "subscript", + "body": "_{$1\\}$0", + "luasnip": { + "autotrigger": true + } + }, + "ceil": { + "prefix": "ceil", + "description": "Ceil", + "body": "\\left\\lceil $1 \\right\\rceil $0" + }, + "floor": { + "prefix": "floor", + "description": "Floor", + "body": "\\left\\lfloor $1 \\right\\rfloor$0" + }, + "pmat": { + "prefix": "pmat", + "description": "Pmat", + "body": "\\begin{pmatrix\\} $1 \\end{pmatrix\\} $0" + }, + "bmat": { + "prefix": "bmat", + "description": "Bmat", + "body": "\\begin{bmatrix\\} $1 \\end{bmatrix\\} $0" + }, + "conj": { + "prefix": "conj", + "description": "conjugate", + "body": "\\overline{$1\\}$0" + }, + "sum": { + "prefix": "sum", + "description": "sum", + "body": "\\sum_{n=${1:1}\\}^{${2:\\infty}\\} ${3:a_n z^n}" + }, + "taylor": { + "prefix": "taylor", + "description": "taylor", + "body": "\\sum_{${1:k}=${2:0}\\}^{${3:\\infty}\\} ${4:c_$1} (x-a)^$1 $0" + }, + "lim": { + "prefix": "lim", + "description": "limit", + "body": "\\lim_{${1:n} \\to ${2:\\infty}\\} " + }, + "limsup": { + "prefix": "limsup", + "description": "limsup", + "body": "\\limsup_{${1:n} \\to ${2:\\infty}\\} " + }, + "part": { + "prefix": "part", + "description": "d/dx", + "body": "\\frac{\\partial ${1:V}\\}{\\partial ${2:x}\\} $0" + }, + "ooo": { + "prefix": "ooo", + "description": "\\infty", + "body": "\\infty" + }, + "rij": { + "prefix": "rij", + "description": "mrij", + "body": "(${1:x}_${2:n})_{${3:$2}\\in${4:\\N}\\}$0" + }, + "=>": { + "prefix": "=>", + "description": "Implies", + "body": "\\implies" + }, + "=<": { + "prefix": "=<", + "description": "Implied by", + "body": "\\impliedby" + }, + "iff": { + "prefix": "iff", + "description": "iff", + "body": "\\iff" + }, + "==": { + "prefix": "==", + "description": "Equals", + "body": "&= $1 \\\\" + }, + "!=": { + "prefix": "!=", + "description": "Not Equal", + "body": "\\neq " + }, + "<=": { + "prefix": "<=", + "description": "leq", + "body": "\\le ", + "luasnip": { + "autotrigger": true + } + }, + ">=": { + "prefix": ">=", + "description": "geq", + "body": "\\ge ", + "luasnip": { + "autotrigger": true + } + }, + "lll": { + "prefix": "lll", + "description": "l", + "body": "\\ell", + "luasnip": { + "autotrigger": true + } + }, + "xx": { + "prefix": "xx", + "description": "cross", + "body": "\\times ", + "luasnip": { + "autotrigger": true + } + }, + "<!": { + "prefix": "<!", + "description": "normal", + "body": "\\triangleleft ", + "luasnip": { + "autotrigger": true + } + }, + "!>": { + "prefix": "!>", + "description": "mapsto", + "body": "\\mapsto ", + "luasnip": { + "autotrigger": true + } + }, + "docls": { + "prefix": "docls", + "description": "Document Class", + "body": "\\documentclass{$1\\}$0", + "luasnip": { + "autotrigger": true + } + }, + "acl": { + "prefix": "acl", + "description": "Acroynm expanded", + "body": "\\acl{${1:acronym}\\}" + }, + "ac": { + "prefix": "ac", + "description": "Acroynm normal", + "body": "\\ac{${1:acronym}\\}" + }, + "ni": { + "prefix": "ni", + "description": "Non-indented paragraph", + "body": "\\noindent" + } +} diff --git a/luasnip_snippets/texmath.json b/luasnip_snippets/texmath.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/texmath.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/typescript.json b/luasnip_snippets/typescript.json new file mode 100644 index 0000000..83a8a50 --- /dev/null +++ b/luasnip_snippets/typescript.json @@ -0,0 +1,21 @@ +{ + "int": { + "prefix": "int", + "description": "interface", + "body": [ + "interface $1 {", + "\\}" + ], + "luasnip": { + "priority": -50 + } + }, + "nspc": { + "prefix": "nspc", + "description": "namespace", + "body": [ + "namespace $1 {", + "\\}" + ] + } +} diff --git a/luasnip_snippets/typescript_react.json b/luasnip_snippets/typescript_react.json new file mode 100644 index 0000000..d8c2f04 --- /dev/null +++ b/luasnip_snippets/typescript_react.json @@ -0,0 +1,16 @@ +{ + "rfc": { + "prefix": "rfc", + "description": "react functional component", + "body": [ + "import React, { FC \\} from \"react\"", + "", + "interface ${1:function_name}Props {${4:props_types}\\}", + "", + "export const ${1:function_name}: FC<${1:function_name}Props> = (${2:props}) => ${3:function_body}" + ], + "luasnip": { + "priority": -49 + } + } +} diff --git a/luasnip_snippets/vim.json b/luasnip_snippets/vim.json new file mode 100644 index 0000000..570bcb5 --- /dev/null +++ b/luasnip_snippets/vim.json @@ -0,0 +1,23 @@ +{ + "gvar": { + "prefix": "gvar", + "description": "Global / configuration variable", + "body": [ + "if !exists(\"g:${1:MyUltraImportantVar}\")", + "\tlet g:$1 = ${2:\"${3:<tab>}\"}", + "endif" + ], + "luasnip": { + "priority": -50 + } + }, + "f": { + "prefix": "f", + "description": "function", + "body": [ + "fun ${1:function_name}($2)", + "\t${3:\" code}", + "endf" + ] + } +} diff --git a/luasnip_snippets/vue.json b/luasnip_snippets/vue.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/vue.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/xhtml.json b/luasnip_snippets/xhtml.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/luasnip_snippets/xhtml.json @@ -0,0 +1 @@ +{} diff --git a/luasnip_snippets/xml.json b/luasnip_snippets/xml.json new file mode 100644 index 0000000..aac9340 --- /dev/null +++ b/luasnip_snippets/xml.json @@ -0,0 +1,13 @@ +{ + "xml": { + "prefix": "xml", + "description": "XML declaration", + "body": [ + "<?xml version=\"1.0\"?>", + "" + ], + "luasnip": { + "priority": -50 + } + } +} diff --git a/luasnip_snippets/zsh.json b/luasnip_snippets/zsh.json new file mode 100644 index 0000000..7634060 --- /dev/null +++ b/luasnip_snippets/zsh.json @@ -0,0 +1,13 @@ +{ + "#!": { + "prefix": "#!", + "description": "#!/usr/bin/env zsh", + "body": [ + "#!/usr/bin/env zsh", + "$0" + ], + "luasnip": { + "priority": -49 + } + } +} |
