1
0
Fork 0

modules(neovim): add snippets

This commit is contained in:
Antoine Langlois 2024-04-12 15:35:55 +02:00
parent 04156437c4
commit adec6206d8
Signed by: DataHearth
GPG Key ID: ABF6737C63396D35
6 changed files with 1522 additions and 1 deletions

View File

@ -68,7 +68,14 @@ in
lsp = import ./plugins/lsp.nix;
lspkind.enable = true;
lualine.enable = true;
luasnip.enable = true;
luasnip = {
enable = true;
fromVscode = [
{
paths = ./snippets;
}
];
};
nix.enable = true;
nvim-autopairs.enable = true;
telescope = import ./plugins/telescope.nix;

View File

@ -0,0 +1,71 @@
{
"type function declaration": {
"prefix": "tyf",
"body": "type ${1:name} func($3) $4",
"description": "Snippet for a type function declaration"
},
"type interface declaration": {
"prefix": "tyi",
"body": "type ${1:name} interface {\n\t$0\n}",
"description": "Snippet for a type interface"
},
"type struct declaration": {
"prefix": "tys",
"body": "type ${1:name} struct {\n\t$0\n}",
"description": "Snippet for a struct declaration"
},
"package main and main function": {
"prefix": "pkgm",
"body": "package main\n\nfunc main() {\n\t$0\n}",
"description": "Snippet for main package & function"
},
"function declaration": {
"prefix": "func",
"body": "func $1($2) $3 {\n\t$0\n}",
"description": "Snippet for function declaration"
},
"if err != nil": {
"prefix": "ir",
"body": "if err != nil {\n\t${1:return ${2:nil, }${3:err}}\n}",
"description": "Snippet for if err != nil"
},
"http handler declaration": {
"prefix": "hand",
"body": "func $1(${2:w} http.ResponseWriter, ${3:r} *http.Request) {\n\t$0\n}",
"description": "Snippet for http handler declaration"
},
"table driven test": {
"prefix": "tdt",
"body": "func Test$1(t *testing.T) {\n\ttestCases := []struct {\n\t\tdesc\tstring\n\t\t$2\n\t}{\n\t\t{\n\t\t\tdesc: \"$3\",\n\t\t\t$4\n\t\t},\n\t}\n\tfor _, tC := range testCases {\n\t\tt.Run(tC.desc, func(t *testing.T) {\n\t\t\t$0\n\t\t})\n\t}\n}",
"description": "Snippet for table driven test"
},
"json tag": {
"prefix": "json",
"body": "`json:\"$1\"`",
"description": "Snippet for struct json tag"
},
"for range statement": {
"prefix": "forr",
"body": "for ${1:_, }${2:v} := range ${3:v} {\n\t$0\n}",
"description": "Snippet for a for range loop"
},
"for statement": {
"prefix": "for",
"body": "for ${1}{\n\t$0\n}",
"description": "Snippet for a pure for loop"
},
"for n statement": {
"prefix": "fori",
"body": "for ${1:i} := ${2:0}; $1 < ${3:count}; $1${4:++} {\n\t$0\n}",
"description": "Snippet for a for loop"
},
"map declaration": {
"prefix": "map",
"body": "map[${1:type}]${2:type}",
"description": "Snippet for a map"
},
"if err := func(); err != nil": {
"pref": "ief",
"body": "if err := $1; err != nil {\n\t${2:return}}"
}
}

View File

@ -0,0 +1,964 @@
{
"doctype": {
"prefix": "doctype",
"body": [
"<!DOCTYPE>",
"$1"
],
"description": "HTML - Defines the document type",
"scope": "text.html"
},
"a": {
"prefix": "a",
"body": "<a href=\"$1\">$2</a>$3",
"description": "HTML - Defines a hyperlink",
"scope": "text.html"
},
"abbr": {
"prefix": "abbr",
"body": "<abbr title=\"$1\">$2</abbr>$3",
"description": "HTML - Defines an abbreviation",
"scope": "text.html"
},
"address": {
"prefix": "address",
"body": [
"<address>",
"$1",
"</address>"
],
"description": "HTML - Defines an address element",
"scope": "text.html"
},
"area": {
"prefix": "area",
"body": "<area shape=\"$1\" coords=\"$2\" href=\"$3\" alt=\"$4\">$5",
"description": "HTML - Defines an area inside an image map",
"scope": "text.html"
},
"article": {
"prefix": "article",
"body": [
"<article>",
"\t$1",
"</article>"
],
"description": "HTML - Defines an article",
"scope": "text.html"
},
"aside": {
"prefix": "aside",
"body": [
"<aside>",
"\t$1",
"</aside>$2"
],
"description": "HTML - Defines content aside from the page content",
"scope": "text.html"
},
"audio": {
"prefix": "audio",
"body": [
"<audio controls>",
"\t$1",
"</audio>"
],
"description": "HTML - Defines sounds content",
"scope": "text.html"
},
"b": {
"prefix": "b",
"body": "<b>$1</b>$2",
"description": "HTML - Defines bold text",
"scope": "text.html"
},
"base": {
"prefix": "base",
"body": "<base href=\"$1\" target=\"$2\">$3",
"description": "HTML - Defines a base URL for all the links in a page",
"scope": "text.html"
},
"bdi": {
"prefix": "bdi",
"body": "<bdi>$1</bdi>$2",
"description": "HTML - Used to isolate text that is of unknown directionality",
"scope": "text.html"
},
"bdo": {
"prefix": "bdo",
"body": [
"<bdo dir=\"$1\">",
"$2",
"</bdo>"
],
"description": "HTML - Defines the direction of text display",
"scope": "text.html"
},
"big": {
"prefix": "big",
"body": "<big>$1</big>$2",
"description": "HTML - Used to make text bigger",
"scope": "text.html"
},
"blockquote": {
"prefix": "blockquote",
"body": [
"<blockquote cite=\"$2\">",
"\t$1",
"</blockquote>"
],
"description": "HTML - Defines a long quotation",
"scope": "text.html"
},
"body": {
"prefix": "body",
"body": [
"<body>",
"\t$0",
"</body>"
],
"description": "HTML - Defines the body element",
"scope": "text.html"
},
"br": {
"prefix": "br",
"body": "<br>",
"description": "HTML - Inserts a single line break",
"scope": "text.html"
},
"button": {
"prefix": "button",
"body": "<button type=\"$1\">$2</button>$3",
"description": "HTML - Defines a push button",
"scope": "text.html"
},
"canvas": {
"prefix": "canvas",
"body": "<canvas id=\"$1\">$2</canvas>$3",
"description": "HTML - Defines graphics",
"scope": "text.html"
},
"caption": {
"prefix": "caption",
"body": "<caption>$1</caption>$2",
"description": "HTML - Defines a table caption",
"scope": "text.html"
},
"cite": {
"prefix": "cite",
"body": "<cite>$1</cite>$2",
"description": "HTML - Defines a citation",
"scope": "text.html"
},
"code": {
"prefix": "code",
"body": "<code>$1</code>$2",
"description": "HTML - Defines computer code text",
"scope": "text.html"
},
"col": {
"prefix": "col",
"body": "<col>$2",
"description": "HTML - Defines attributes for table columns",
"scope": "text.html"
},
"colgroup": {
"prefix": "colgroup",
"body": [
"<colgroup>",
"\t$1",
"</colgroup>"
],
"description": "HTML - Defines group of table columns",
"scope": "text.html"
},
"command": {
"prefix": "command",
"body": "<command>$1</command>$2",
"description": "HTML - Defines a command button [not supported]",
"scope": "text.html"
},
"datalist": {
"prefix": "datalist",
"body": [
"<datalist>",
"\t$1",
"</datalist>"
],
"description": "HTML - Defines a dropdown list",
"scope": "text.html"
},
"dd": {
"prefix": "dd",
"body": "<dd>$1</dd>$2",
"description": "HTML - Defines a definition description",
"scope": "text.html"
},
"del": {
"prefix": "del",
"body": "<del>$1</del>$2",
"description": "HTML - Defines deleted text",
"scope": "text.html"
},
"details": {
"prefix": "details",
"body": [
"<details>",
"\t$1",
"</details>"
],
"description": "HTML - Defines details of an element",
"scope": "text.html"
},
"dialog": {
"prefix": "dialog",
"body": "<dialog>$1</dialog>$2",
"description": "HTML - Defines a dialog (conversation)",
"scope": "text.html"
},
"dfn": {
"prefix": "dfn",
"body": "<dfn>$1</dfn>$2",
"description": "HTML - Defines a definition term",
"scope": "text.html"
},
"div": {
"prefix": "div",
"body": [
"<div>",
"\t$1",
"</div>"
],
"description": "HTML - Defines a section in a document",
"scope": "text.html"
},
"dl": {
"prefix": "dl",
"body": [
"<dl>",
"\t$1",
"</dl>"
],
"description": "HTML - Defines a definition list",
"scope": "text.html"
},
"dt": {
"prefix": "dt",
"body": "<dt>$1</dt>$2",
"description": "HTML - Defines a definition term",
"scope": "text.html"
},
"em": {
"prefix": "em",
"body": "<em>$1</em>$2",
"description": "HTML - Defines emphasized text",
"scope": "text.html"
},
"embed": {
"prefix": "embed",
"body": "<embed src=\"$1\">$2",
"description": "HTML - Defines external interactive content ot plugin",
"scope": "text.html"
},
"fieldset": {
"prefix": "fieldset",
"body": [
"<fieldset>",
"\t$1",
"</fieldset>"
],
"description": "HTML - Defines a fieldset",
"scope": "text.html"
},
"figcaption": {
"prefix": "figcaption",
"body": "<figcaption>$1</figcaption>$2",
"description": "HTML - Defines a caption for a figure",
"scope": "text.html"
},
"figure": {
"prefix": "figure",
"body": [
"<figure>",
"\t$1",
"</figure>"
],
"description": "HTML - Defines a group of media content, and their caption",
"scope": "text.html"
},
"footer": {
"prefix": "footer",
"body": [
"<footer>",
"\t$1",
"</footer>"
],
"description": "HTML - Defines a footer for a section or page",
"scope": "text.html"
},
"form": {
"prefix": "form",
"body": [
"<form>",
"\t$1",
"</form>"
],
"description": "HTML - Defines a form",
"scope": "text.html"
},
"h1": {
"prefix": "h1",
"body": "<h1>$1</h1>$2",
"description": "HTML - Defines header 1",
"scope": "text.html"
},
"h2": {
"prefix": "h2",
"body": "<h2>$1</h2>$2",
"description": "HTML - Defines header 2",
"scope": "text.html"
},
"h3": {
"prefix": "h3",
"body": "<h3>$1</h3>$2",
"description": "HTML - Defines header 3",
"scope": "text.html"
},
"h4": {
"prefix": "h4",
"body": "<h4>$1</h4>$2",
"description": "HTML - Defines header 4",
"scope": "text.html"
},
"h5": {
"prefix": "h5",
"body": "<h5>$1</h5>$2",
"description": "HTML - Defines header 5",
"scope": "text.html"
},
"h6": {
"prefix": "h6",
"body": "<h6>$1</h6>$2",
"description": "HTML - Defines header 6",
"scope": "text.html"
},
"head": {
"prefix": "head",
"body": [
"<head>",
"\t$1",
"</head>"
],
"description": "HTML - Defines information about the document",
"scope": "text.html"
},
"header": {
"prefix": "header",
"body": [
"<header>",
"\t$1",
"</header>"
],
"description": "HTML - Defines a header for a section of page",
"scope": "text.html"
},
"hgroup": {
"prefix": "hgroup",
"body": [
"<hgroup>",
"\t$1",
"</hgroup>"
],
"description": "HTML - Defines information about a section in a document",
"scope": "text.html"
},
"hr": {
"prefix": "hr",
"body": "<hr>",
"description": "HTML - Defines a horizontal rule",
"scope": "text.html"
},
"html": {
"prefix": "html",
"body": [
"<html>",
"\t$0",
"</html>"
],
"description": "HTML - Defines an html document",
"scope": "text.html"
},
"html5": {
"prefix": "html5",
"body": [
"<!DOCTYPE html>",
"<html lang=\"$1en\">",
"\t<head>",
"\t\t<meta charset=\"UTF-8\">",
"\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">",
"\t\t<title>$2</title>",
"\t\t<link href=\"$3css/style.css\" rel=\"stylesheet\">",
"\t</head>",
"\t<body>",
"\t$0",
"\t</body>",
"</html>"
],
"description": "HTML - Defines a template for a html5 document",
"scope": "text.html"
},
"i": {
"prefix": "i",
"body": "<i>$1</i>$2",
"description": "HTML - Defines italic text",
"scope": "text.html"
},
"iframe": {
"prefix": "iframe",
"body": "<iframe src=\"$1\">$2</iframe>$3",
"description": "HTML - Defines an inline sub window",
"scope": "text.html"
},
"img": {
"prefix": "img",
"body": "<img src=\"$1\" alt=\"$2\">$3",
"description": "HTML - Defines an image",
"scope": "text.html"
},
"input": {
"prefix": "input",
"body": "<input type=\"$1\" name=\"$2\" value=\"$3\">$4",
"description": "HTML - Defines an input field",
"scope": "text.html"
},
"ins": {
"prefix": "ins",
"body": "<ins>$1</ins>$2",
"description": "HTML - Defines inserted text",
"scope": "text.html"
},
"keygen": {
"prefix": "keygen",
"body": "<keygen name=\"$1\">$2",
"description": "HTML - Defines a generated key in a form",
"scope": "text.html"
},
"kbd": {
"prefix": "kbd",
"body": "<kbd>$1</kbd>$2",
"description": "HTML - Defines keyboard text",
"scope": "text.html"
},
"label": {
"prefix": "label",
"body": "<label for=\"$1\">$2</label>$3",
"description": "HTML - Defines an inline window",
"scope": "text.html"
},
"legend": {
"prefix": "legend",
"body": "<legend>$1</legend>$2",
"description": "HTML - Defines a title in a fieldset",
"scope": "text.html"
},
"li": {
"prefix": "li",
"body": "<li>$1</li>$2",
"description": "HTML - Defines a list item",
"scope": "text.html"
},
"link": {
"prefix": "link",
"body": "<link rel=\"$1\" type=\"$2\" href=\"$3\">$4",
"description": "HTML - Defines a resource reference",
"scope": "text.html"
},
"main": {
"prefix": "main",
"body": [
"<main>",
"\t$1",
"</main>"
],
"description": "HTML - Defines an image map",
"scope": "text.html"
},
"map": {
"prefix": "map",
"body": [
"<map name=\"$1\">",
"\t$2",
"</map>"
],
"description": "HTML - Defines an image map",
"scope": "text.html"
},
"mark": {
"prefix": "mark",
"body": "<mark>$1</mark>$2",
"description": "HTML - Defines marked text",
"scope": "text.html"
},
"menu": {
"prefix": "menu",
"body": [
"<menu>",
"\t$1",
"</menu>"
],
"description": "HTML - Defines a menu list",
"scope": "text.html"
},
"menuitem": {
"prefix": "menuitem",
"body": "<menuitem>$1</menuitem>$2",
"description": "HTML - Defines a menu item [firefox only]",
"scope": "text.html"
},
"meta": {
"prefix": "meta",
"body": "<meta name=\"$1\" content=\"$2\">$3",
"description": "HTML - Defines meta information",
"scope": "text.html"
},
"meter": {
"prefix": "meter",
"body": "<meter value=\"$1\">$2</meter>$3",
"description": "HTML - Defines measurement within a predefined range",
"scope": "text.html"
},
"nav": {
"prefix": "nav",
"body": [
"<nav>",
"\t$1",
"</nav>"
],
"description": "HTML - Defines navigation links",
"scope": "text.html"
},
"noscript": {
"prefix": "noscript",
"body": [
"<noscript>",
"$1",
"</noscript>"
],
"description": "HTML - Defines a noscript section",
"scope": "text.html"
},
"object": {
"prefix": "object",
"body": "<object width=\"$1\" height=\"$2\" data=\"$3\">$4</object>$5",
"description": "HTML - Defines an embedded object",
"scope": "text.html"
},
"ol": {
"prefix": "ol",
"body": [
"<ol>",
"\t$1",
"</ol>"
],
"description": "HTML - Defines an ordered list",
"scope": "text.html"
},
"optgroup": {
"prefix": "optgroup",
"body": [
"<optgroup>",
"\t$1",
"</optgroup>"
],
"description": "HTML - Defines an option group",
"scope": "text.html"
},
"option": {
"prefix": "option",
"body": "<option value=\"$1\">$2</option>$3",
"description": "HTML - Defines an option in a drop-down list",
"scope": "text.html"
},
"output": {
"prefix": "output",
"body": "<output name=\"$1\" for=\"$2\">$3</output>$4",
"description": "HTML - Defines some types of output",
"scope": "text.html"
},
"p": {
"prefix": "p",
"body": "<p>$1</p>$2",
"description": "HTML - Defines a paragraph",
"scope": "text.html"
},
"param": {
"prefix": "param",
"body": "<param name=\"$1\" value=\"$2\">$3",
"description": "HTML - Defines a parameter for an object",
"scope": "text.html"
},
"pre": {
"prefix": "pre",
"body": [
"<pre>$1</pre>"
],
"description": "HTML - Defines preformatted text",
"scope": "text.html"
},
"progress": {
"prefix": "progress",
"body": "<progress value=\"$1\" max=\"$2\">$3</progress>$4",
"description": "HTML - Defines progress of a task of any kind",
"scope": "text.html"
},
"q": {
"prefix": "q",
"body": "<q>$1</q>$2",
"description": "HTML - Defines a short quotation",
"scope": "text.html"
},
"rp": {
"prefix": "rp",
"body": "<rp>$1</rp>$2",
"description": "HTML - Used in ruby annotations to define what to show browsers that do not support the ruby element",
"scope": "text.html"
},
"rt": {
"prefix": "rt",
"body": "<rt>$1</rt>$2",
"description": "HTML - Defines explanation to ruby annotations",
"scope": "text.html"
},
"ruby": {
"prefix": "ruby",
"body": [
"<ruby>",
"$1",
"</ruby>"
],
"description": "HTML - Defines ruby annotations",
"scope": "text.html"
},
"s": {
"prefix": "s",
"body": "<s>$1</s>$2",
"description": "HTML - Used to define strikethrough text",
"scope": "text.html"
},
"samp": {
"prefix": "samp",
"body": "<samp>$1</samp>$2",
"description": "HTML - Defines sample computer code",
"scope": "text.html"
},
"script": {
"prefix": "script",
"body": [
"<script>",
"\t$1",
"</script>"
],
"description": "HTML - Defines a script",
"scope": "text.html"
},
"section": {
"prefix": "section",
"body": [
"<section>",
"\t$1",
"</section>"
],
"description": "HTML - Defines a section",
"scope": "text.html"
},
"select": {
"prefix": "select",
"body": [
"<select>",
"\t$1",
"</select>"
],
"description": "HTML - Defines a selectable list",
"scope": "text.html"
},
"small": {
"prefix": "small",
"body": "<small>$1</small>$2",
"description": "HTML - Defines small text",
"scope": "text.html"
},
"source": {
"prefix": "source",
"body": "<source src=\"$1\" type=\"$2\">$3",
"description": "HTML - Defines media resource",
"scope": "text.html"
},
"span": {
"prefix": "span",
"body": "<span>$1</span>$2",
"description": "HTML - Defines a section in a document",
"scope": "text.html"
},
"strong": {
"prefix": "strong",
"body": "<strong>$1</strong>$2",
"description": "HTML - Defines strong text",
"scope": "text.html"
},
"style": {
"prefix": "style",
"body": [
"<style>",
"$1",
"</style>"
],
"description": "HTML - Defines a style definition",
"scope": "text.html"
},
"sub": {
"prefix": "sub",
"body": "<sub>$1</sub>$2",
"description": "HTML - Defines sub-scripted text",
"scope": "text.html"
},
"sup": {
"prefix": "sup",
"body": "<sup>$1</sup>$2",
"description": "HTML - Defines super-scripted text",
"scope": "text.html"
},
"summary": {
"prefix": "summary",
"body": "<summary>$1</summary>$2",
"description": "HTML - Defines a visible heading for the detail element [limited support]",
"scope": "text.html"
},
"table": {
"prefix": "table",
"body": [
"<table>",
"\t$1",
"</table>"
],
"description": "HTML - Defines a table",
"scope": "text.html"
},
"tbody": {
"prefix": "tbody",
"body": [
"<tbody>",
"\t$1",
"</tbody>"
],
"description": "HTML - Defines a table body",
"scope": "text.html"
},
"td": {
"prefix": "td",
"body": "<td>$1</td>$2",
"description": "HTML - Defines a table cell",
"scope": "text.html"
},
"textarea": {
"prefix": "textarea",
"body": "<textarea rows=\"$1\" cols=\"$2\">$3</textarea>$4",
"description": "HTML - Defines a text area",
"scope": "text.html"
},
"tfoot": {
"prefix": "tfoot",
"body": [
"<tfoot>",
"\t$1",
"</tfoot>"
],
"description": "HTML - Defines a table footer",
"scope": "text.html"
},
"thead": {
"prefix": "thead",
"body": [
"<thead>",
"$1",
"</thead>"
],
"description": "HTML - Defines a table head",
"scope": "text.html"
},
"th": {
"prefix": "th",
"body": "<th>$1</th>$2",
"description": "HTML - Defines a table header",
"scope": "text.html"
},
"time": {
"prefix": "time",
"body": "<time datetime=\"$1\">$2</time>$3",
"description": "HTML - Defines a date/time",
"scope": "text.html"
},
"title": {
"prefix": "title",
"body": "<title>$1</title>$2",
"description": "HTML - Defines the document title",
"scope": "text.html"
},
"tr": {
"prefix": "tr",
"body": "<tr>$1</tr>$2",
"description": "HTML - Defines a table row",
"scope": "text.html"
},
"track": {
"prefix": "track",
"body": "<track src=\"$1\" kind=\"$2\" srclang=\"$3\" label=\"$4\">$5",
"description": "HTML - Defines a table row",
"scope": "text.html"
},
"u": {
"prefix": "u",
"body": "<u>$1</u>$2",
"description": "HTML - Used to define underlined text",
"scope": "text.html"
},
"ul": {
"prefix": "ul",
"body": [
"<ul>",
"\t$1",
"</ul>"
],
"description": "HTML - Defines an unordered list",
"scope": "text.html"
},
"var": {
"prefix": "var",
"body": "<var>$1</var>$2",
"description": "HTML - Defines a variable",
"scope": "text.html"
},
"video": {
"prefix": "video",
"body": [
"<video width=\"$1\" height=\"$2\" controls>",
"\t$3",
"</video>"
],
"description": "HTML - Defines a video",
"scope": "text.html"
},
"div.": {
"prefix": "div.",
"body": [
"<div class=\"$1\">",
"\t$2",
"</div>"
],
"description": "HTML - Defines a section in a document",
"scope": "text.html"
},
"div#": {
"prefix": "div#",
"body": [
"<div id=\"$1\">",
"\t$2",
"</div>"
],
"description": "HTML - Defines a section in a document",
"scope": "text.html"
},
"div.#": {
"prefix": "div.#",
"body": [
"<div class=\"$1\" id=\"$2\">",
"\t$3",
"</div>"
],
"description": "HTML - Defines a section in a document",
"scope": "text.html"
},
"p.": {
"prefix": "p.",
"body": [
"<p class=\"$1\">$2</p>"
],
"description": "HTML - Defines a paragraph",
"scope": "text.html"
},
"p#": {
"prefix": "p#",
"body": [
"<p id=\"$1\">$2</p>"
],
"description": "HTML - Defines a paragraph",
"scope": "text.html"
},
"p.#": {
"prefix": "p.#",
"body": [
"<p class=\"$1\" id=\"$2\">$3</p>"
],
"description": "HTML - Defines a paragraph",
"scope": "text.html"
},
"ul.": {
"prefix": "ul.",
"body": [
"<ul class=\"$1\">",
"\t$2",
"</ul>"
],
"description": "HTML - Defines an unordered list",
"scope": "text.html"
},
"ul#": {
"prefix": "ul#",
"body": [
"<ul id=\"$1\">",
"\t$2",
"</ul>"
],
"description": "HTML - Defines an unordered list",
"scope": "text.html"
},
"ul.#": {
"prefix": "ul.#",
"body": [
"<ul class=\"$1\" id=\"$2\">",
"\t$3",
"</ul>"
],
"description": "HTML - Defines an unordered list",
"scope": "text.html"
},
"ol.": {
"prefix": "ol.",
"body": [
"<ol class=\"$1\">",
"\t$2",
"</ol>"
],
"description": "HTML - Defines an ordered list",
"scope": "text.html"
},
"ol#": {
"prefix": "ol#",
"body": [
"<ol id=\"$1\">",
"\t$2",
"</ol>"
],
"description": "HTML - Defines an ordered list",
"scope": "text.html"
},
"ol.#": {
"prefix": "ol.#",
"body": [
"<ol class=\"$1\" id=\"$2\">",
"\t$3",
"</ol>"
],
"description": "HTML - Defines an ordered list",
"scope": "text.html"
}
}

View File

@ -0,0 +1,359 @@
{
"MIT": {
"prefix": "mitl",
"description": "MIT License",
"body": [
"The MIT License (MIT)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}",
"",
"Permission is hereby granted, free of charge, to any person obtaining a copy",
"of this software and associated documentation files (the \"Software\"), to deal",
"in the Software without restriction, including without limitation the rights",
"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell",
"copies of the Software, and to permit persons to whom the Software is",
"furnished to do so, subject to the following conditions:",
"",
"The above copyright notice and this permission notice shall be included in all",
"copies or substantial portions of the Software.",
"",
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
"SOFTWARE."
]
},
"GPL2": {
"prefix": "GPL2",
"description": "GPLv2 License",
"body": [
"The GPLv2 License (GPLv2)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation; either version 2 of the License, or",
"(at your option) any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <http://www.gnu.org/licenses/>."
]
},
"LGPL2": {
"prefix": "LGPL2",
"description": "GPLv2 License",
"body": [
"The GPLv2 License (GPLv2)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}",
"",
"This library is free software; you can redistribute it and/or modify",
"it under the terms of the GNU Lesser General Public License as published",
"by the Free Software Foundation; either version 2.1 of the License, or",
"(at your option) any later version.",
"",
"This library is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU Lesser General Public License for more details.",
"",
"You should have received a copy of the GNU Lesser General Public License",
"along with this program. If not, see <http://www.gnu.org/licenses/>."
]
},
"GPL3": {
"prefix": "GPL3",
"description": "GPLv3 License",
"body": [
"The GPLv3 License (GPLv3)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation, either version 3 of the License, or",
"(at your option) any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <http://www.gnu.org/licenses/>."
]
},
"LGPL3": {
"prefix": "LGPL3",
"description": "LGPLv3 License",
"body": [
"The GPLv3 License (GPLv3)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU Lesser General Public License as published",
"the Free Software Foundation, either version 3 of the License, or",
"(at your option) any later version.",
"",
"This library is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU Lesser General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <http://www.gnu.org/licenses/>."
]
},
"AGPL3": {
"prefix": "AGPL3",
"description": "AGPLv3 License",
"body": [
"The AGPLv3 License (AGPLv3)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU Affero General Public License as",
"published by the Free Software Foundation, either version 3 of the",
"License, or (at your option) any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU Affero General Public License for more details.",
"",
"You should have received a copy of the GNU Affero General Public License",
"along with this program. If not, see <http://www.gnu.org/licenses/>."
]
},
"BSD2": {
"prefix": "BSD2",
"description": "BSD2 License",
"body": [
"The BSD2 License (BSD2)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All rights reserved.",
"",
"Redistribution and use in source and binary forms, with or without",
"modification, are permitted provided that the following conditions are met:",
"1. Redistributions of source code must retain the above copyright",
"notice, this list of conditions and the following disclaimer.",
"2. Redistributions in binary form must reproduce the above copyright",
"notice, this list of conditions and the following disclaimer in the",
"documentation and/or other materials provided with the distribution.",
"",
"THIS SOFTWARE IS PROVIDED BY $1 ''AS IS'' AND ANY",
"EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED",
"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE",
"DISCLAIMED. IN NO EVENT SHALL $1 BE LIABLE FOR ANY",
"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;",
"LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND",
"ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT",
"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS",
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
"",
"The views and conclusions contained in the software and documentation",
"are those of the authors and should not be interpreted as representing",
"official policies, either expressed or implied, of $1."
]
},
"BSD3": {
"prefix": "BSD3",
"description": "BSD3 License",
"body": [
"The BSD3 License (BSD3)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All rights reserved.",
"",
"Redistribution and use in source and binary forms, with or without",
"modification, are permitted provided that the following conditions are met:",
"1. Redistributions of source code must retain the above copyright",
"notice, this list of conditions and the following disclaimer.",
"2. Redistributions in binary form must reproduce the above copyright",
"notice, this list of conditions and the following disclaimer in the",
"documentation and/or other materials provided with the distribution.",
"3. Neither the name of the nor the",
"names of its contributors may be used to endorse or promote products",
"derived from this software without specific prior written permission.",
"",
"THIS SOFTWARE IS PROVIDED BY $1 ''AS IS'' AND ANY",
"EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED",
"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE",
"DISCLAIMED. IN NO EVENT SHALL $1 BE LIABLE FOR ANY",
"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;",
"LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND",
"ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT",
"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS",
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
]
},
"BSD4": {
"prefix": "BSD4",
"description": "BSD4 License",
"body": [
"The BSD4 License (BSD4)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All rights reserved.",
"",
"Redistribution and use in source and binary forms, with or without",
"modification, are permitted provided that the following conditions are met:",
"1. Redistributions of source code must retain the above copyright",
"notice, this list of conditions and the following disclaimer.",
"2. Redistributions in binary form must reproduce the above copyright",
"notice, this list of conditions and the following disclaimer in the",
"documentation and/or other materials provided with the distribution.",
"3. All advertising materials mentioning features or use of this software",
"must display the following acknowledgement:",
"This product includes software developed by the .",
"4. Neither the name of the $3 nor the",
"names of its contributors may be used to endorse or promote products",
"derived from this software without specific prior written permission.",
"",
"THIS SOFTWARE IS PROVIDED BY $1 ''AS IS'' AND ANY",
"EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED",
"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE",
"DISCLAIMED. IN NO EVENT SHALL $1 BE LIABLE FOR ANY",
"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;",
"LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND",
"ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT",
"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS",
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
]
},
"APACHE": {
"prefix": "APACHE",
"description": "APACHE License",
"body": [
"The APACHE License (APACHE)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All rights reserved.",
"",
"Licensed under the Apache License, Version 2.0 (the \"License\");",
"you may not use this file except in compliance with the License.",
"You may obtain a copy of the License at",
"",
"\thttp://www.apache.org/licenses/LICENSE-2.0",
"",
"Unless required by applicable law or agreed to in writing, software",
"distributed under the License is distributed on an \"AS IS\" BASIS,",
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
"See the License for the specific language governing permissions and",
"limitations under the License."
]
},
"BEERWARE": {
"prefix": "BEERWARE",
"description": "BEERWARE License",
"body": [
"The BEERWARE License (BEERWARE)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All rights reserved.",
"",
"Licensed under the \"THE BEER-WARE LICENSE\" (Revision 42):",
"$1 wrote this file. As long as you retain this notice you",
"can do whatever you want with this stuff. If we meet some day, and you think",
"this stuff is worth it, you can buy me a beer or coffee in return"
]
},
"WTFPL": {
"prefix": "WTFPL",
"description": "WTFPL License",
"body": [
"\tDO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All rights reserved.",
"",
"Licensed under the \"THE BEER-WARE LICENSE\" (Revision 42):",
"Everyone is permitted to copy and distribute verbatim or modified",
"copies of this license document, and changing it is allowed as long",
"as the name is changed.",
"",
"\tDO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE",
"TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION",
"\t0. You just DO WHAT THE FUCK YOU WANT TO."
]
},
"MPL2": {
"prefix": "MPL2",
"description": "MPL2 License",
"body": [
"This Source Code Form is subject to the terms of the Mozilla Public",
"License, v. 2.0. If a copy of the MPL was not distributed with this",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All rights reserved.",
"file, You can obtain one at http://mozilla.org/MPL/2.0/."
]
},
"AGPL": {
"prefix": "AGPL",
"description": "AGPL License",
"body": [
"The AGPL License (AGPL)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All rights reserved.",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU Affero General Public License as",
"published by the Free Software Foundation, either version 3 of the",
"License, or (at your option) any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU Affero General Public License for more details.",
"",
"You should have received a copy of the GNU Affero General Public License",
"along with this program. If not, see <http://www.gnu.org/licenses/>."
]
},
"ISC": {
"prefix": "ISCL",
"description": "ISC License",
"body": [
"The ISC License (ISC)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All rights reserved.",
"",
"Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.",
"",
"THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE."
]
},
"EUPL": {
"prefix": "EUPL",
"description": "EUPL License",
"body": [
"The EUPL License (EUPL)",
"",
"Copyright (c) ${CURRENT_YEAR} ${0:Author}",
"Licensed under the EUPL, Version 1.2 or as soon they will be approved by the European Commission - subsequent versions of the EUPL (the ''Licence'');",
"You may not use this work except in compliance with the Licence.",
"You may obtain a copy of the Licence at:",
"",
"<https://joinup.ec.europa.eu/software/page/eupl>",
"",
"Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an ''AS IS'' basis,",
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
"See the Licence for the specific language governing permissions and limitations under the Licence."
]
},
"SPDX": {
"prefix": "spdx",
"description": "SPDX-style license header",
"body": [
"SPDX-License-Identifier: ${1:Id}",
"SPDX-FileCopyrightText: ${CURRENT_YEAR} ${2:Author}"
]
}
}

View File

@ -0,0 +1,97 @@
{
"ifelse": {
"prefix": "if",
"body": [
"if $1 then",
" $2",
"else$0"
],
"description": "if-else block"
},
"letin": {
"prefix": "let",
"body": [
"let",
" $1",
"in $0"
],
"description": "let-in block"
},
"hash": {
"prefix": "hash",
"body": "\"${1:sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=}\";",
"description": "Empty hash"
},
"fetchFrom": {
"prefix": "fetchFrom",
"body": [
"fetchFrom${1|GitHub,GitLab,Gitea,Gitiles,BitBucket,Savannah,RepoOrCz,SourceHut|} {",
" owner = \"$2\";",
" repo = \"$3\";",
" rev = \"${4:v\\${version\\}}\";",
" hash = \"${5:sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=}\";",
"};"
],
"description": "fetchFromGitHub, or any other common fetcher from Nixpkgs"
},
"fetchurl": {
"prefix": "fetchurl",
"body": [
"fetchurl {",
" url = \"$1\";",
" hash = \"${2:sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=}\";",
"};"
],
"description": "fetchurl with default empty hash"
},
"package-arguments": {
"prefix": "pkg",
"body": [
"{ lib",
", ${1:stdenv}",
", $2",
"}:",
"",
"$0"
],
"description": "Package arguments, starting with { lib"
},
"stdenv.mkDerivation": {
"prefix": "mkd",
"body": [
"stdenv.mkDerivation (finalAttrs: {",
" pname = \"$1\";",
" version = \"$2\";",
"",
" src = $3",
"",
" nativeBuildInputs = [",
" $4",
" ];",
" buildInputs = [",
" $0",
" ];",
"",
" meta = {",
" description = \"$5\";",
" homepage = \"$6\";",
" license = lib.licenses.$7;",
" maintainers = with lib.maintainers; [ $8 ];",
" };",
"})"
],
"description": "Nixpkgs' stdenv.mkDerivation template"
},
"meta": {
"prefix": "meta",
"body": [
"meta = {",
" description = \"$1\";",
" homepage = \"$2\";",
" license = lib.licenses.$3;",
" maintainers = with lib.maintainers; [ $0 ];",
"};"
],
"description": "Nixpkgs' minimal meta attribute set"
}
}

View File

@ -0,0 +1,23 @@
{
"name": "my-snippets",
"contributes": {
"snippets": [
{
"language": "go",
"path": "./go.json"
},
{
"language": "html",
"path": "./html.json"
},
{
"language": "nix",
"path": "./nix.json"
},
{
"language": "license",
"path": "./license.json"
}
]
}
}