From caed88f50ee0b85d2f8fe74772524b3abdd6a0a4 Mon Sep 17 00:00:00 2001 From: wscats <2587575267@qq.com> Date: Fri, 3 May 2019 22:00:41 +0800 Subject: [PATCH] add js css html snippets --- .DS_Store | Bin 6148 -> 8196 bytes README.md | 9 +- package.json | 32 +- snippets/css.json | 587 +++++++++++++++++++ snippets/html.json | 844 +++++++++++++++++++++++++++ snippets/js.json | 698 ++++++++++++++++++++++ snippets/{snippets.json => omi.json} | 7 + test/index.omi | 19 + test/index.vue | 12 + 9 files changed, 2205 insertions(+), 3 deletions(-) create mode 100644 snippets/css.json create mode 100644 snippets/html.json create mode 100644 snippets/js.json rename snippets/{snippets.json => omi.json} (93%) create mode 100644 test/index.omi create mode 100644 test/index.vue diff --git a/.DS_Store b/.DS_Store index 512bf648b95230f8709f4f05b83824040da71fd2..1e34c491c36c9427e541c1621d873ed2d11c0f43 100644 GIT binary patch delta 357 zcmZoMXmOBWU|?W$DortDU;r^WfEYvza8E20o2aMA$p?}L@)&1aWxj-phhGK?1AYA~2sSG7Ro-Ts{ zgC2ts5E}z=8BipXp~5pKKRGEUKM7F^U6?m;p0x zvn8t}BPR>cEvZ1eOC~R56&8g{0u>@;JXmgs!g*!EMR_^-dFenEjFas}Bscr>>}TeZ k;0E$tL4mbdkmEb^WPTCP$^JYX9Ki4bg(Jh}c%C`T01_ooIsgCw delta 119 zcmZp1XfcprU|?W$DortDU=RQ@Ie-{Mvv5r;6q~50$PE%;1dF9^jM&J`$g$Z>z<_Zx zlaLtW#` block uses the syntax highlighting currently active for you norma > Note you may need to explicitly disable Sublime's default `JavaScript` package to make it work. +# Thanks + +- [html-snippets](https://github.com/abusaidm/html-snippets) +- [vscode-javascript](https://github.com/xabikos/vscode-javascript) +- [vscode-javascript-snippets](https://github.com/nathanchapman/vscode-javascript-snippets) +- [vsc-css-snippets](https://github.com/joy-yu/vsc-css-snippets) + # License [MIT](http://opensource.org/licenses/MIT) @[Eno Yao](https://github.com/Wscats) diff --git a/package.json b/package.json index 7ec2cc8..561444e 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,10 @@ "type": "git", "url": "https://github.com/Wscats/omi-snippets" }, + "bugs": { + "url": "https://github.com/Wscats/omi-snippets/issues", + "email": "kalone.cool@gmail.com" + }, "categories": [ "Programming Languages" ], @@ -80,11 +84,35 @@ "snippets": [ { "language": "omi", - "path": "./snippets/snippets.json" + "path": "./snippets/omi.json" + }, + { + "language": "omi", + "path": "./snippets/js.json" + }, + { + "language": "omi", + "path": "./snippets/html.json" + }, + { + "language": "omi", + "path": "./snippets/css.json" + }, + { + "language": "eno", + "path": "./snippets/omi.json" + }, + { + "language": "eno", + "path": "./snippets/js.json" + }, + { + "language": "eno", + "path": "./snippets/html.json" }, { "language": "eno", - "path": "./snippets/snippets.json" + "path": "./snippets/css.json" } ] }, diff --git a/snippets/css.json b/snippets/css.json new file mode 100644 index 0000000..ed4e7cf --- /dev/null +++ b/snippets/css.json @@ -0,0 +1,587 @@ +{ + "align-items": { + "prefix": "ai", + "body": "align-items: ${1:center};" + }, + "align-items: baseline": { + "prefix": "aib", + "body": "align-items: baseline;" + }, + "align-items: center": { + "prefix": "aic", + "body": "align-items: center;" + }, + "align-items: flex-start": { + "prefix": "aifs", + "body": "align-items: flex-start;" + }, + "align-items flex-end": { + "prefix": "aife", + "body": "align-items: flex-end;" + }, + "align-items stretch": { + "prefix": "ais", + "body": "align-items: stretch;" + }, + "animation": { + "prefix": "ani", + "body": "${4:${1:name} ${2:1s} ${3:infinite}};" + }, + "background": { + "prefix": "bg", + "body": "background: ${1:#fff};" + }, + "background-color": { + "prefix": "bgc", + "body": "background-color: ${1:#fff};" + }, + "background-image": { + "prefix": "bgi", + "body": "background-image: ${2:url(\"${1:background.jpg}\")};" + }, + "background-image (asset-url)": { + "prefix": "bgia", + "body": "background-image: ${2:asset-url(\"${1:background.jpg}\")};" + }, + "background-position": { + "prefix": "bgp", + "body": "background-position: ${1:left} ${2:top};" + }, + "background-repeat": { + "prefix": "bgr", + "body": "background-repeat: ${1:repeat};" + }, + "background-repeat: repeat": { + "prefix": "bgrr", + "body": "background-repeat: repeat;" + }, + "background-repeat: repeat-x": { + "prefix": "bgrx", + "body": "background-repeat: repeat-x;" + }, + "background-repeat: repeat-y": { + "prefix": "bgry", + "body": "background-repeat: repeat-y;" + }, + "background-repeat: no-repeat": { + "prefix": "bgrn", + "body": "background-repeat: no-repeat;" + }, + "background-size": { + "prefix": "bgs", + "body": "background-size: ${1:cover};" + }, + "border": { + "prefix": "bor", + "body": "border: ${4:${1:1px} ${2:solid} ${3:#000}};" + }, + "border: none": { + "prefix": "born", + "body": "border: ${1:none};" + }, + "border-color": { + "prefix": "borc", + "body": "border-color: ${1:#${2:000}};" + }, + "border-style": { + "prefix": "bors", + "body": "border-style: ${3:solid};" + }, + "border-width": { + "prefix": "borw", + "body": "border-width: ${1:1px};" + }, + "border-bottom": { + "prefix": "borb", + "body": "border-bottom: ${4:${1:1px} ${2:solid} ${3:#000}};" + }, + "border-bottom-width": { + "prefix": "borbw", + "body": "border-bottom-width: ${1:1px};" + }, + "border-left": { + "prefix": "borl", + "body": "border-left: ${4:${1:1px} ${2:solid} ${3:#000}};" + }, + "border-left-width": { + "prefix": "borlw", + "body": "border-left-width: ${1:1px};" + }, + "border-right": { + "prefix": "borr", + "body": "border-right: ${4:${1:1px} ${2:solid} ${3:#000}};" + }, + "border-right-width": { + "prefix": "borrw", + "body": "border-right-width: ${1:1px};" + }, + "border-top": { + "prefix": "bort", + "body": "border-top: ${4:${1:1px} ${2:solid} ${3:#000}};" + }, + "border-top-width": { + "prefix": "bortw", + "body": "border-top-width: ${1:1px};" + }, + "border-radius": { + "prefix": "br", + "body": "border-radius: ${1:1px};" + }, + "bottom": { + "prefix": "bot", + "body": "bottom: ${1:0};" + }, + "box-shadow": { + "prefix": "bos", + "body": "box-shadow: ${1:1px} ${2:1px} ${3:1px} ${4:1px} ${5:rgba(0, 0, 0, .5)};" + }, + "box-sizing": { + "prefix": "boz", + "body": "box-sizing: ${1:border-box};" + }, + "clear": { + "prefix": "clr", + "body": "clear: ${1:both};" + }, + "color": { + "prefix": "col", + "body": "color: ${1:#${2:000}};" + }, + "content": { + "prefix": "con", + "body": "content: '$1';" + }, + "cursor": { + "prefix": "cur", + "body": "cursor: ${1:pointer};" + }, + "cursor: pointer": { + "prefix": "curp", + "body": "cursor: pointer;" + }, + "cursor: default": { + "prefix": "curd", + "body": "cursor: default;" + }, + "cursor: inherit": { + "prefix": "curi", + "body": "cursor: inherit;" + }, + "display": { + "prefix": "dis", + "body": "display: ${1:none};" + }, + "display: block": { + "prefix": "disb", + "body": "display: block;" + }, + "display: inline-block": { + "prefix": "disi", + "body": "display: inline-block;" + }, + "display: none": { + "prefix": "disn", + "body": "display: none;" + }, + "display: flex": { + "prefix": "disf", + "body": "display: flex;" + }, + "fill": { + "prefix": "fill", + "body": "fill: ${1:#${2:000}};" + }, + "flex": { + "prefix": "flex", + "body": "flex: ${1:1} ${2:1} ${3:auto};" + }, + "flex (alt)": { + "prefix": "fle", + "body": "flex: ${1:1} ${2:1} ${3:auto};" + }, + "flex-direction": { + "prefix": "fd", + "body": "flex-direction: ${1:column};" + }, + "flex-direction: row": { + "prefix": "fdr", + "body": "flex-direction: row;" + }, + "flex-direction: column": { + "prefix": "fdc", + "body": "flex-direction: column;" + }, + "float": { + "prefix": "fl", + "body": "float: ${1:left};" + }, + "float: left": { + "prefix": "fll", + "body": "float: left;" + }, + "float: right": { + "prefix": "flr", + "body": "float: right;" + }, + "float: none": { + "prefix": "fln", + "body": "float: none;" + }, + "font-family": { + "prefix": "ff", + "body": "font-family: ${1:arial};" + }, + "font-size": { + "prefix": "fs", + "body": "font-size: ${1:1px};" + }, + "font-style": { + "prefix": "fst", + "body": "font-style: ${1:italic};" + }, + "font-style: italic": { + "prefix": "fsti", + "body": "font-style: italic;" + }, + "font-style: normal": { + "prefix": "fstn", + "body": "font-style: normal;" + }, + "font-style: oblique": { + "prefix": "fsto", + "body": "font-style: oblique;" + }, + "font-weight": { + "prefix": "fw", + "body": "font-weight: ${1:bold};" + }, + "font-weight: bold": { + "prefix": "fwb", + "body": "font-weight: bold;" + }, + "font-weight: light": { + "prefix": "fwl", + "body": "font-weight: light;" + }, + "font-weight: normal": { + "prefix": "fwn", + "body": "font-weight: normal;" + }, + "height": { + "prefix": "hei", + "body": "height: ${1:1px};" + }, + "height: auto": { + "prefix": "heia", + "body": "height: auto;" + }, + "justify-content": { + "prefix": "jc", + "body": "justify-content: ${1:center};" + }, + "justify-content: flex-end": { + "prefix": "jcfe", + "body": "justify-content: flex-end;" + }, + "justify-content: flex-start": { + "prefix": "jcfs", + "body": "justify-content: flex-start;" + }, + "justify-content: center": { + "prefix": "jcc", + "body": "justify-content: center;" + }, + "justify-content: space-around": { + "prefix": "jca", + "body": "justify-content: space-around;" + }, + "justify-content: space-between": { + "prefix": "jcb", + "body": "justify-content: space-between;" + }, + "list-style": { + "prefix": "lis", + "body": "list-style: ${1:square} ${2:inside} ${4:url(\"${3:list.png}\")};" + }, + "list-style-type": { + "prefix": "list", + "body": "list-style-type: ${1:circle};" + }, + "list-style-type: circle": { + "prefix": "listc", + "body": "list-style-type: circle;" + }, + "list-style-type: disc": { + "prefix": "listd", + "body": "list-style-type: disc;" + }, + "list-style-type: lower-roman": { + "prefix": "listlr", + "body": "list-style-type: lower-roman;" + }, + "list-style-type: none": { + "prefix": "listn", + "body": "list-style-type: none;" + }, + "list-style-type: square": { + "prefix": "lists", + "body": "list-style-type: square;" + }, + "list-style-type: upper-roman": { + "prefix": "listur", + "body": "list-style-type: upper-roman;" + }, + "left": { + "prefix": "left", + "body": "left: ${1:0};" + }, + "left (shorthand)": { + "prefix": "lef", + "body": "left: ${1:0};" + }, + "line-height": { + "prefix": "lh", + "body": "line-height: ${1:1px};" + }, + "letter-spacing": { + "prefix": "ls", + "body": "letter-spacing: ${1:1px};" + }, + "letter-spacing: normal": { + "prefix": "lsn", + "body": "letter-spacing: normal;" + }, + "margin": { + "prefix": "mar", + "body": "margin: ${1:1px};" + }, + "margin-bottom": { + "prefix": "marb", + "body": "margin-bottom: ${1:1px};" + }, + "margin-left": { + "prefix": "marl", + "body": "margin-left: ${1:1px};" + }, + "margin-right": { + "prefix": "marr", + "body": "margin-right: ${1:1px};" + }, + "margin-top": { + "prefix": "mart", + "body": "margin-top: ${1:1px};" + }, + "margin: 0 auto": { + "prefix": "mara", + "body": "margin: 0 auto;" + }, + "min-height": { + "prefix": "mih", + "body": "min-height: ${1:1px};" + }, + "min-width": { + "prefix": "miw", + "body": "min-width: ${1:1px};" + }, + "max-height": { + "prefix": "mah", + "body": "max-height: ${1:1px};" + }, + "max-width": { + "prefix": "maw", + "body": "max-width: ${1:1px};" + }, + "order": { + "prefix": "ord", + "body": "order: ${1:1};" + }, + "overflow": { + "prefix": "ov", + "body": "overflow: ${1:hidden};" + }, + "overflow: auto": { + "prefix": "ova", + "body": "overflow: auto;" + }, + "overflow: hidden": { + "prefix": "ovh", + "body": "overflow: hidden;" + }, + "overflow: scroll": { + "prefix": "ovs", + "body": "overflow: scroll;" + }, + "overflow: visible": { + "prefix": "ovv", + "body": "overflow: visible;" + }, + "padding": { + "prefix": "pad", + "body": "padding: ${1:1px};" + }, + "padding-bottom": { + "prefix": "padb", + "body": "padding-bottom: ${1:1px};" + }, + "padding-left": { + "prefix": "padl", + "body": "padding-left: ${1:1px};" + }, + "padding-right": { + "prefix": "padr", + "body": "padding-right: ${1:1px};" + }, + "padding-top": { + "prefix": "padt", + "body": "padding-top: ${1:1px};" + }, + "position": { + "prefix": "pos", + "body": "position: ${1:relative};" + }, + "position absolute": { + "prefix": "posa", + "body": "position: absolute;" + }, + "position fixed": { + "prefix": "posf", + "body": "position: fixed;" + }, + "position relative": { + "prefix": "posr", + "body": "position: relative;" + }, + "position static": { + "prefix": "poss", + "body": "position: static;" + }, + "right": { + "prefix": "rig", + "body": "right: ${1:0};" + }, + "text-align": { + "prefix": "ta", + "body": "text-align: ${1:center};" + }, + "text-align: center": { + "prefix": "tac", + "body": "text-align: center;" + }, + "text-align: left": { + "prefix": "tal", + "body": "text-align: left;" + }, + "text-align: right": { + "prefix": "tar", + "body": "text-align: right;" + }, + "text-decoration": { + "prefix": "td", + "body": "text-decoration: ${1:underline};" + }, + "text-decoration: underline": { + "prefix": "tdu", + "body": "text-decoration: underline;" + }, + "text-decoration: none": { + "prefix": "tdn", + "body": "text-decoration: none;" + }, + "text-transform": { + "prefix": "tt", + "body": "text-transform: ${1:uppercase};" + }, + "text-transform: capitalize": { + "prefix": "ttc", + "body": "text-transform: ${1:capitalize};" + }, + "text-transform: lowercase": { + "prefix": "ttl", + "body": "text-transform: ${1:lowercase};" + }, + "text-transform: none": { + "prefix": "ttn", + "body": "text-transform: ${1:none};" + }, + "text-transform: uppercase": { + "prefix": "ttu", + "body": "text-transform: ${1:uppercase};" + }, + "top": { + "prefix": "top", + "body": "top: ${1:0};" + }, + "vertical-align": { + "prefix": "va", + "body": "vertical-align: ${1:middle};" + }, + "vertical-align: bottom": { + "prefix": "vab", + "body": "vertical-align: bottom;" + }, + "vertical-align: middle": { + "prefix": "vam", + "body": "vertical-align: middle;" + }, + "vertical-align: top": { + "prefix": "vat", + "body": "vertical-align: top;" + }, + "white-space": { + "prefix": "ws", + "body": "white-space: ${1:nowrap};" + }, + "white-space: nowrap": { + "prefix": "wsn", + "body": "white-space: nowrap;" + }, + "white-space: normal": { + "prefix": "wsnor", + "body": "white-space: normal;" + }, + "white-space: pre": { + "prefix": "wsp", + "body": "white-space: pre;" + }, + "width": { + "prefix": "wid", + "body": "width: ${1:1px};" + }, + "width: auto": { + "prefix": "wida", + "body": "width: auto;" + }, + "z-index": { + "prefix": "zi", + "body": "z-index: ${1:1};" + }, + "@import": { + "prefix": "imp", + "body": "@import '${1:filename}';" + }, + "@include": { + "prefix": "inc", + "body": "@include ${1:mixin};" + }, + "@keyframes": { + "prefix": "key", + "body": "@keyframes ${1:name} {\n $2\n}" + }, + "@media": { + "prefix": "med", + "body": "@media ${1:screen} and (${2:max-width: 300px}) {\n $3\n}" + }, + "@mixin": { + "prefix": "mix", + "body": "@mixin ${1:name} {\n $2\n}" + }, + "!important": { + "prefix": "!", + "body": "!important" + }, + "!important (alt)": { + "prefix": "i", + "body": "!important" + } + } + \ No newline at end of file diff --git a/snippets/html.json b/snippets/html.json new file mode 100644 index 0000000..fb60311 --- /dev/null +++ b/snippets/html.json @@ -0,0 +1,844 @@ +{ + "doctype": { + "prefix": "doctype", + "body": [ + "", + "$1" + ], + "description": "HTML - Defines the document type", + "scope": "text.html" + }, + "a": { + "prefix": "a", + "body": "$2$3", + "description": "HTML - Defines a hyperlink", + "scope": "text.html" + }, + "abbr": { + "prefix": "abbr", + "body": "$2$3", + "description": "HTML - Defines an abbreviation", + "scope": "text.html" + }, + "address": { + "prefix": "address", + "body": [ + "
", + "$1", + "
" + ], + "description": "HTML - Defines an address element", + "scope": "text.html" + }, + "area": { + "prefix": "area", + "body": "\"$4\"$5", + "description": "HTML - Defines an area inside an image map", + "scope": "text.html" + }, + "article": { + "prefix": "article", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines an article", + "scope": "text.html" + }, + "aside": { + "prefix": "aside", + "body": [ + "$2" + ], + "description": "HTML - Defines content aside from the page content", + "scope": "text.html" + }, + "audio": { + "prefix": "audio", + "body": [ + "" + ], + "description": "HTML - Defines sounds content", + "scope": "text.html" + }, + "b": { + "prefix": "b", + "body": "$1$2", + "description": "HTML - Defines bold text", + "scope": "text.html" + }, + "base": { + "prefix": "base", + "body": "$3", + "description": "HTML - Defines a base URL for all the links in a page", + "scope": "text.html" + }, + "bdi": { + "prefix": "bdi", + "body": "$1$2", + "description": "HTML - Used to isolate text that is of unknown directionality", + "scope": "text.html" + }, + "bdo": { + "prefix": "bdo", + "body": [ + "", + "$2", + ""], + "description": "HTML - Defines the direction of text display", + "scope": "text.html" + }, + "big": { + "prefix": "big", + "body": "$1$2", + "description": "HTML - Used to make text bigger", + "scope": "text.html" + }, + "blockquote": { + "prefix": "blockquote", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines a long quotation", + "scope": "text.html" + }, + "body": { + "prefix": "body", + "body": [ + "", + "\t$1", + ""], + "description": "HTML - Defines the body element", + "scope": "text.html" + }, + "br": { + "prefix": "br", + "body": "
", + "description": "HTML - Inserts a single line break", + "scope": "text.html" + }, + "button": { + "prefix": "button", + "body": "$3", + "description": "HTML - Defines a push button", + "scope": "text.html" + }, + "canvas": { + "prefix": "canvas", + "body": "$2$3", + "description": "HTML - Defines graphics", + "scope": "text.html" + }, + "caption": { + "prefix": "caption", + "body": "$1$2", + "description": "HTML - Defines a table caption", + "scope": "text.html" + }, + "cite": { + "prefix": "cite", + "body": "$1$2", + "description": "HTML - Defines a citation", + "scope": "text.html" + }, + "code": { + "prefix": "code", + "body": "$1$2", + "description": "HTML - Defines computer code text", + "scope": "text.html" + }, + "col": { + "prefix": "col", + "body": "$2", + "description": "HTML - Defines attributes for table columns", + "scope": "text.html" + }, + "colgroup": { + "prefix": "colgroup", + "body": [ + "", + "\t$1", + ""], + "description": "HTML - Defines group of table columns", + "scope": "text.html" + }, + "command": { + "prefix": "command", + "body": "$1$2", + "description": "HTML - Defines a command button [not supported]", + "scope": "text.html" + }, + "datalist": { + "prefix": "datalist", + "body": [ + "", + "\t$1", + "" + ], + "description": "HTML - Defines a dropdown list", + "scope": "text.html" + }, + "dd": { + "prefix": "dd", + "body": "
$1
$2", + "description": "HTML - Defines a definition description", + "scope": "text.html" + }, + "del": { + "prefix": "del", + "body": "$1$2", + "description": "HTML - Defines deleted text", + "scope": "text.html" + }, + "details": { + "prefix": "details", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines details of an element", + "scope": "text.html" + }, + "dialog": { + "prefix": "dialog", + "body": "$1$2", + "description": "HTML - Defines a dialog (conversation)", + "scope": "text.html" + }, + "dfn": { + "prefix": "dfn", + "body": "$1$2", + "description": "HTML - Defines a definition term", + "scope": "text.html" + }, + "div": { + "prefix": "div", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines a section in a document", + "scope": "text.html" + }, + "dl": { + "prefix": "dl", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines a definition list", + "scope": "text.html" + }, + "dt": { + "prefix": "dt", + "body": "
$1
$2", + "description": "HTML - Defines a definition term", + "scope": "text.html" + }, + "em": { + "prefix": "em", + "body": "$1$2", + "description": "HTML - Defines emphasized text", + "scope": "text.html" + }, + "embed": { + "prefix": "embed", + "body": "$2", + "description": "HTML - Defines external interactive content ot plugin", + "scope": "text.html" + }, + "fieldset": { + "prefix": "fieldset", + "body": [ + "
", + "\t$1", + "
"], + "description": "HTML - Defines a fieldset", + "scope": "text.html" + }, + "figcaption": { + "prefix": "figcaption", + "body": "
$1
$2", + "description": "HTML - Defines a caption for a figure", + "scope": "text.html" + }, + "figure": { + "prefix": "figure", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines a group of media content, and their caption", + "scope": "text.html" + }, + "footer": { + "prefix": "footer", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines a footer for a section or page", + "scope": "text.html" + }, + "form": { + "prefix": "form", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines a form", + "scope": "text.html" + }, + "h1": { + "prefix": "h1", + "body": "

$1

$2", + "description": "HTML - Defines header 1", + "scope": "text.html" + }, + "h2": { + "prefix": "h2", + "body": "

$1

$2", + "description": "HTML - Defines header 2", + "scope": "text.html" + }, + "h3": { + "prefix": "h3", + "body": "

$1

$2", + "description": "HTML - Defines header 3", + "scope": "text.html" + }, + "h4": { + "prefix": "h4", + "body": "

$1

$2", + "description": "HTML - Defines header 4", + "scope": "text.html" + }, + "h5": { + "prefix": "h5", + "body": "
$1
$2", + "description": "HTML - Defines header 5", + "scope": "text.html" + }, + "h6": { + "prefix": "h6", + "body": "
$1
$2", + "description": "HTML - Defines header 6", + "scope": "text.html" + }, + "head": { + "prefix": "head", + "body": [ + "", + "\t$1", + "" + ], + "description": "HTML - Defines information about the document", + "scope": "text.html" + }, + "header": { + "prefix": "header", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines a header for a section of page", + "scope": "text.html" + }, + "hgroup": { + "prefix": "hgroup", + "body": [ + "
", + "\t$1", + "
" + ], + "description": "HTML - Defines information about a section in a document", + "scope": "text.html" + }, + "hr": { + "prefix": "hr", + "body": "
", + "description": "HTML - Defines a horizontal rule", + "scope": "text.html" + }, + "html": { + "prefix": "html", + "body": [ + "", + "\t$1", + "" + ], + "description": "HTML - Defines an html document", + "scope": "text.html" + }, + "html5": { + "prefix": "html5", + "body": [ + "", + "", + "\t", + "\t\t$2", + "\t\t", + "\t\t", + "\t\t", + "\t", + "\t", + "\t$4", + "\t", + "" + ], + "description": "HTML - Defines a template for a html5 document", + "scope": "text.html" + }, + "i": { + "prefix": "i", + "body": "$1$2", + "description": "HTML - Defines italic text", + "scope": "text.html" + }, + "iframe": { + "prefix": "iframe", + "body": "$3", + "description": "HTML - Defines an inline sub window", + "scope": "text.html" + }, + "img": { + "prefix": "img", + "body": "\"$2\"$3", + "description": "HTML - Defines an image", + "scope": "text.html" + }, + "input": { + "prefix": "input", + "body": "$4", + "description": "HTML - Defines an input field", + "scope": "text.html" + }, + "ins": { + "prefix": "ins", + "body": "$1$2", + "description": "HTML - Defines inserted text", + "scope": "text.html" + }, + "keygen": { + "prefix": "keygen", + "body": "$2", + "description": "HTML - Defines a generated key in a form", + "scope": "text.html" + }, + "kbd": { + "prefix": "kbd", + "body": "$1$2", + "description": "HTML - Defines keyboard text", + "scope": "text.html" + }, + "label": { + "prefix": "label", + "body": "$3", + "description": "HTML - Defines an inline window", + "scope": "text.html" + }, + "legend": { + "prefix": "legend", + "body": "$1$2", + "description": "HTML - Defines a title in a fieldset", + "scope": "text.html" + }, + "li": { + "prefix": "li", + "body": "
  • $1
  • $2", + "description": "HTML - Defines a list item", + "scope": "text.html" + }, + "link": { + "prefix": "link", + "body": "$4", + "description": "HTML - Defines a resource reference", + "scope": "text.html" + }, + "main": { + "prefix": "main", + "body": [ + "
    ", + "\t$1", + "
    " + ], + "description": "HTML - Defines an image map", + "scope": "text.html" + }, + "map": { + "prefix": "map", + "body": [ + "", + "\t$2", + ""], + "description": "HTML - Defines an image map", + "scope": "text.html" + }, + "mark": { + "prefix": "mark", + "body": "$1$2", + "description": "HTML - Defines marked text", + "scope": "text.html" + }, + "menu": { + "prefix": "menu", + "body": [ + "", + "\t$1", + "" + ], + "description": "HTML - Defines a menu list", + "scope": "text.html" + }, + "menuitem": { + "prefix": "menuitem", + "body": "$1$2", + "description": "HTML - Defines a menu item [firefox only]", + "scope": "text.html" + }, + "meta": { + "prefix": "meta", + "body": "$3", + "description": "HTML - Defines meta information", + "scope": "text.html" + }, + "meter": { + "prefix": "meter", + "body": "$2$3", + "description": "HTML - Defines measurement within a predefined range", + "scope": "text.html" + }, + "nav": { + "prefix": "nav", + "body": [ + "" + ], + "description": "HTML - Defines navigation links", + "scope": "text.html" + }, + "noscript": { + "prefix": "noscript", + "body": [ + "" + ], + "description": "HTML - Defines a noscript section", + "scope": "text.html" + }, + "object": { + "prefix": "object", + "body": "$4$5", + "description": "HTML - Defines an embedded object", + "scope": "text.html" + }, + "ol": { + "prefix": "ol", + "body": [ + "
      ", + "\t$1", + "
    " + ], + "description": "HTML - Defines an ordered list", + "scope": "text.html" + }, + "optgroup": { + "prefix": "optgroup", + "body": [ + "", + "\t$1", + "" + ], + "description": "HTML - Defines an option group", + "scope": "text.html" + }, + "option": { + "prefix": "option", + "body": "$3", + "description": "HTML - Defines an option in a drop-down list", + "scope": "text.html" + }, + "output": { + "prefix": "output", + "body": "$3$4", + "description": "HTML - Defines some types of output", + "scope": "text.html" + }, + "p": { + "prefix": "p", + "body": "

    $1

    $2", + "description": "HTML - Defines a paragraph", + "scope": "text.html" + }, + "param": { + "prefix": "param", + "body": "$3", + "description": "HTML - Defines a parameter for an object", + "scope": "text.html" + }, + "pre": { + "prefix": "pre", + "body": [ + "
    $1
    " + ], + "description": "HTML - Defines preformatted text", + "scope": "text.html" + }, + "progress": { + "prefix": "progress", + "body": "$3$4", + "description": "HTML - Defines progress of a task of any kind", + "scope": "text.html" + }, + "q": { + "prefix": "q", + "body": "$1$2", + "description": "HTML - Defines a short quotation", + "scope": "text.html" + }, + "rp": { + "prefix": "rp", + "body": "$1$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": "$1$2", + "description": "HTML - Defines explanation to ruby annotations", + "scope": "text.html" + }, + "ruby": { + "prefix": "ruby", + "body": [ + "", + "$1", + "" + ], + "description": "HTML - Defines ruby annotations", + "scope": "text.html" + }, + "s": { + "prefix": "s", + "body": "$1$2", + "description": "HTML - Used to define strikethrough text", + "scope": "text.html" + }, + "samp": { + "prefix": "samp", + "body": "$1$2", + "description": "HTML - Defines sample computer code", + "scope": "text.html" + }, + "script": { + "prefix": "script", + "body": [ + "" + ], + "description": "HTML - Defines a script", + "scope": "text.html" + }, + "section": { + "prefix": "section", + "body": [ + "
    ", + "\t$1", + "
    " + ], + "description": "HTML - Defines a section", + "scope": "text.html" + }, + "select": { + "prefix": "select", + "body": [ + "" + ], + "description": "HTML - Defines a selectable list", + "scope": "text.html" + }, + "small": { + "prefix": "small", + "body": "$1$2", + "description": "HTML - Defines small text", + "scope": "text.html" + }, + "source": { + "prefix": "source", + "body": "$3", + "description": "HTML - Defines media resource", + "scope": "text.html" + }, + "span": { + "prefix": "span", + "body": "$1$2", + "description": "HTML - Defines a section in a document", + "scope": "text.html" + }, + "strong": { + "prefix": "strong", + "body": "$1$2", + "description": "HTML - Defines strong text", + "scope": "text.html" + }, + "style": { + "prefix": "style", + "body": [ + "" + ], + "description": "HTML - Defines a style definition", + "scope": "text.html" + }, + "sub": { + "prefix": "sub", + "body": "$1$2", + "description": "HTML - Defines sub-scripted text", + "scope": "text.html" + }, + "sup": { + "prefix": "sup", + "body": "$1$2", + "description": "HTML - Defines super-scripted text", + "scope": "text.html" + }, + "summary": { + "prefix": "summary", + "body": "$1$2", + "description": "HTML - Defines a visible heading for the detail element [limited support]", + "scope": "text.html" + }, + "table": { + "prefix": "table", + "body": [ + "", + "\t$1", + "
    " + ], + "description": "HTML - Defines a table", + "scope": "text.html" + }, + "tbody": { + "prefix": "tbody", + "body": [ + "", + "\t$1", + "" + ], + "description": "HTML - Defines a table body", + "scope": "text.html" + }, + "td": { + "prefix": "td", + "body": "$1$2", + "description": "HTML - Defines a table cell", + "scope": "text.html" + }, + "textarea": { + "prefix": "textarea", + "body": "$4", + "description": "HTML - Defines a text area", + "scope": "text.html" + }, + "tfoot": { + "prefix": "tfoot", + "body": [ + "", + "\t$1", + "" + ], + "description": "HTML - Defines a table footer", + "scope": "text.html" + }, + "thead": { + "prefix": "thead", + "body": [ + "", + "$1", + "" + ], + "description": "HTML - Defines a table head", + "scope": "text.html" + }, + "th": { + "prefix": "th", + "body": "$1$2", + "description": "HTML - Defines a table header", + "scope": "text.html" + }, + "time": { + "prefix": "time", + "body": "$3", + "description": "HTML - Defines a date/time", + "scope": "text.html" + }, + "title": { + "prefix": "title", + "body": "$1$2", + "description": "HTML - Defines the document title", + "scope": "text.html" + }, + "tr": { + "prefix": "tr", + "body": "$1$2", + "description": "HTML - Defines a table row", + "scope": "text.html" + }, + "track": { + "prefix": "track", + "body": "$5", + "description": "HTML - Defines a table row", + "scope": "text.html" + }, + "u": { + "prefix": "u", + "body": "$1$2", + "description": "HTML - Used to define underlined text", + "scope": "text.html" + }, + "ul": { + "prefix": "ul", + "body": [ + "
      ", + "\t$1", + "
    " + ], + "description": "HTML - Defines an unordered list", + "scope": "text.html" + }, + "var": { + "prefix": "var", + "body": "$1$2", + "description": "HTML - Defines a variable", + "scope": "text.html" + }, + "video": { + "prefix": "video", + "body": [ + ""], + "description": "HTML - Defines a video", + "scope": "text.html" + } +} diff --git a/snippets/js.json b/snippets/js.json new file mode 100644 index 0000000..8707aac --- /dev/null +++ b/snippets/js.json @@ -0,0 +1,698 @@ +{ + "import": { + "prefix": "imp", + "body": "import ${2:moduleName} from '${1:module}';$0", + "description": "Imports entire module statement in ES6 syntax" + }, + "importNoModuleName": { + "prefix": "imn", + "body": "import '${1:module}';$0", + "description": "Imports entire module in ES6 syntax without module name" + }, + "importDestructing": { + "prefix": "imd", + "body": "import { $2 } from '${1:module}';$0", + "description": "Imports only a portion of the module in ES6 syntax" + }, + "importEverything": { + "prefix": "ime", + "body": "import * as ${2:alias} from '${1:module}';$0", + "description": "Imports everything as alias from the module in ES6 syntax" + }, + "importAs": { + "prefix": "ima", + "body": "import { ${2:originalName} as ${3:alias} } from '${1:module}';$0", + "description": "Imports a specific portion of the module by assigning a local alias in ES6 syntax" + }, + "require": { + "prefix": "rqr", + "body": "require('${1:package}');", + "description": "Require a package" + }, + "moduleExports": { + "prefix": "mde", + "body": "module.exports = {\n\t$0\n};\n", + "description": "Module exports from Common JS, node syntax at ES6" + }, + "exportNamedFunction": { + "prefix": "enf", + "body": "export const ${1:functionName} = (${2:params}) => {\n\t$0\n};\n", + "description": "Export named function in ES6 syntax" + }, + "exportDefaultFunction": { + "prefix": "edf", + "body": "export default (${1:params}) => {\n\t$0\n};\n", + "description": "Export default function in ES6 syntax" + }, + "exportClass": { + "prefix": "ecl", + "body": "export default class ${1:className} {\n\t$0\n};\n", + "description": "Export default class in ES6 syntax" + }, + "exportClassExtends": { + "prefix": "ece", + "body": "export default class ${1:className} extends ${2:baseclassName} {\n\t$0\n};\n", + "description": "Export default class which extends a base one in ES6 syntax" + }, + "constructor": { + "prefix": "con", + "body": "constructor(${1:params}) {\n\t${0}\n}", + "description": "Add default constructor in a class in ES6 syntax" + }, + "method": { + "prefix": "met", + "body": "${1:methodName}(${2:params}) {\n\t${0}\n}", + "description": "Creates a method inside a class in ES6 syntax" + }, + "propertyGet": { + "prefix": "pge", + "body": "get ${1:propertyName}() {\n\treturn this.${0};\n}", + "description": "Creates a getter property inside a class in ES6 syntax" + }, + "propertyset": { + "prefix": "pse", + "body": "set ${1:propertyName}(${2:value}) {\n\t${0};\n}", + "description": "Creates a setter property inside a class in ES6 syntax" + }, + "forEach": { + "prefix": "fre", + "body": "${1:array}.forEach(${2:currentItem} => {\n\t${0}\n});", + "description": "Creates a forEach statement in ES6 syntax" + }, + "forOf": { + "prefix": "fof", + "body": "for (const ${1:item} of ${2:object}) {\n\t${0}\n}", + "description": "Iterating over property names of iterable objects" + }, + "forIn": { + "prefix": "fin", + "body": "for (const ${1:item} in ${2:object}) {\n\t${0}\n}", + "description": "Iterating over property values of iterable objects" + }, + "anonymousFunction": { + "prefix": "anfn", + "body": "(${1:params}) => {\n\t${2}\n}", + "description": "Creates an anonymous function in ES6 syntax" + }, + "namedFunction": { + "prefix": "nfn", + "body": "const ${1:name} = (${2:params}) => {\n\t${3}\n}", + "description": "Creates a named function in ES6 syntax" + }, + "destructingObject": { + "prefix": "dob", + "body": "const {${2:propertyName}} = ${1:objectToDestruct};", + "description": "Creates and assigns a local variable using object destructing" + }, + "destructingArray": { + "prefix": "dar", + "body": "const [${2:propertyName}] = ${1:arrayToDestruct};", + "description": "Creates and assigns a local variable using array destructing" + }, + "setInterval": { + "prefix": "sti", + "body": "setInterval(() => {\n\t${2}\n}, ${0:intervalInms});", + "description": "Executes the given function at specified intervals in ES6 syntax" + }, + "setTimeOut": { + "prefix": "sto", + "body": "setTimeout(() => {\n\t${2}\n}, ${1:delayInms});", + "description": "Executes the given function after the specified delay in ES6 syntax" + }, + "promise": { + "prefix": "prom", + "body": "return new Promise((resolve, reject) => {\n\t${1}\n});", + "description": "Creates and returns a new Promise in the standard ES6 syntax" + }, + "thenCatch": { + "prefix": "thenc", + "body": ".then((${1:result}) => {\n\t${2}\n}).catch((${3:err}) => {\n\t${4}\n});", + "description": "Add the .then and .catch methods to handle promises" + }, + "consoleAssert": { + "prefix": "cas", + "body": "console.assert(${1:expression}, ${2:object});", + "description": "If the specified expression is false, the message is written to the console along with a stack trace" + }, + "consoleClear": { + "prefix": "ccl", + "body": "console.clear();", + "description": "Clears the console" + }, + "consoleCount": { + "prefix": "cco", + "body": "console.count(${1:label});", + "description": "Writes the the number of times that count() has been invoked at the same line and with the same label" + }, + "consoleDir": { + "prefix": "cdi", + "body": "console.dir(${1:object});", + "description": "Prints a JavaScript representation of the specified object" + }, + "consoleError": { + "prefix": "cer", + "body": "console.error(${1:object});", + "description": "Displays a message in the console and also includes a stack trace from where the method was called" + }, + "consoleGroup": { + "prefix": "cgr", + "body": "console.group(\"${1:label}\");", + "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called." + }, + "consoleGroupEnd": { + "prefix": "cge", + "body": "console.groupEnd();", + "description": "Closes out the corresponding console.group()." + }, + "consoleLog": { + "prefix": "clg", + "body": "console.log(${1:object});", + "description": "Displays a message in the console" + }, + "consoleLogObject": { + "prefix": "clo", + "body": "console.log('${1:object} :', ${1:object});", + "description": "Displays an object in the console with its name" + }, + "consoleTrace": { + "prefix": "ctr", + "body": "console.trace(${1:object});", + "description": "Prints a stack trace from the point where the method was called" + }, + "consoleWarn": { + "prefix": "cwa", + "body": "console.warn(${1:object});", + "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message" + }, + "consoleInfo": { + "prefix": "cin", + "body": "console.info(${1:object});", + "description": "Displays a message in the console but also displays a blue information icon along with the logged message" + }, + "consoleTable": { + "prefix": "clt", + "body": "console.table(${1:object});", + "description": "Displays tabular data as a table." + }, + "consoleTime": { + "prefix": "cti", + "body": "console.time(${1:object});", + "description": "Sets starting point for execution time measurement" + }, + "consoleTimeEnd": { + "prefix": "cte", + "body": "console.timeEnd(${1:object});", + "description": "Sets end point for execution time measurement" + }, + + + + "var statement": { + "prefix": "v", + "body": "var ${0}", + "description": "var statement" + }, + "var assignment": { + "prefix": "v=", + "body": "var ${1:name} = ${2:value};", + "description": "var assignment" + }, + "let statement": { + "prefix": "l", + "body": "let ${0}", + "description": "let statement" + }, + "let assignment": { + "prefix": "l=", + "body": "let ${1:name} = ${2:value};", + "description": "let assignment" + }, + "destructuring let assignment": { + "prefix": "dl=", + "body": "let {${1:name}} = ${2:value};", + "description": "destructuring let assignment" + }, + "const statement": { + "prefix": "co", + "body": "const ${0}", + "description": "const statement" + }, + "const assignment": { + "prefix": "co=", + "body": "const ${1:name} = ${2:value};", + "description": "const assignment" + }, + "destructuring const assignment": { + "prefix": "dco=", + "body": "const {${1:name}} = ${2:value};", + "description": "destructuring const assignment" + }, + // Flow Control + "if statement": { + "prefix": "if", + "body": "if (${1:condition}) {\n\t${0}\n}", + "description": "if statement" + }, + "else statement": { + "prefix": "el", + "body": "else {\n\t${0}\n}", + "description": "else statement" + }, + "if/else statement": { + "prefix": "ife", + "body": "if (${1:condition}) {\n\t${0}\n} else {\n\t\n}", + "description": "if/else statement" + }, + "else if statement": { + "prefix": "ei", + "body": "else if (${1:condition}) {\n\t${0}\n}", + "description": "else if statement" + }, + "ternary operator": { + "prefix": "ter", + "body": "${1:condition} ? ${2:expression} : ${3:expression};", + "description": "ternary operator" + }, + "for loop": { + "prefix": "fl", + "body": "for (let ${1:i} = 0, ${2:len} = ${3:iterable}.length; ${1:i} < ${2:len}; ${1:i}++) {\n\t${0}\n}", + "description": "for loop" + }, + "reverse for loop": { + "prefix": "rfl", + "body": "for (let ${1:i} = ${2:iterable}.length - 1; ${1:i} >= 0; ${1:i}--) {\n\t${0}\n}", + "description": "reverse for loop" + }, + "for in loop": { + "prefix": "fi", + "body": "for (let ${1:key} in ${2:array}) {\n\tif (${2:array}.hasOwnProperty(${1:key})) {\n\t\t${0}\n\t}\n}", + "description": "for in loop" + }, + "for of loop (ES6)": { + "prefix": "fo", + "body": "for (let ${1:key} of ${2:array}) {\n\t${0}\n}", + "description": "for of loop (ES6)" + }, + "while loop": { + "prefix": "wl", + "body": "while (${1:condition}) {\n\t${0}\n}", + "description": "while loop" + }, + "try/catch": { + "prefix": "tc", + "body": "try {\n\t${0}\n} catch (${1:err}) {\n\t\n}", + "description": "try/catch" + }, + "try/finally": { + "prefix": "tf", + "body": "try {\n\t${0}\n} finally {\n\t\n}", + "description": "try/finally" + }, + "try/catch/finally": { + "prefix": "tcf", + "body": "try {\n\t${0}\n} catch (${1:err}) {\n\t\n} finally {\n\t\n}", + "description": "try/catch/finally" + }, + "switch case": { + "prefix": "sw", + "body": "switch (${1:expr}) {\n\tcase ${2:value}:\n\t\treturn $0;\n\tdefault:\n\t\treturn;\n}", + "description": "switch case" + }, + // Functions + "anonymous function": { + "prefix": "f", + "body": "function (${1:arguments}) {\n\t${0}\n}", + "description": "anonymous function" + }, + "named function": { + "prefix": "fn", + "body": "function ${1:name}(${2:arguments}) {\n\t${0}\n}", + "description": "named function" + }, + "immediately-invoked function expression (IIFE)": { + "prefix": "iife", + "body": "((${1:arguments}) => {\n\t${0}\n})(${2});", + "description": "immediately-invoked function expression (IIFE)" + }, + "function apply": { + "prefix": "fa", + "body": "${1:fn}.apply(${2:this}, ${3:arguments})", + "description": "function apply" + }, + "function call": { + "prefix": "fc", + "body": "${1:fn}.call(${2:this}, ${3:arguments})", + "description": "function call" + }, + "function bind": { + "prefix": "fb", + "body": "${1:fn}.bind(${2:this}, ${3:arguments})", + "description": "function bind" + }, + "arrow function (ES6)": { + "prefix": "af", + "body": "(${1:arguments}) => ${2:statement}", + "description": "arrow function (ES6)" + }, + "arrow function with body (ES6)": { + "prefix": "afb", + "body": "(${1:arguments}) => {\n\t${0}\n}", + "description": "arrow function with body (ES6)" + }, + "generator function (ES6)": { + "prefix": "gf", + "body": "function* (${1:arguments}) {\n\t${0}\n}", + "description": "generator function (ES6)" + }, + "named generator function (ES6)": { + "prefix": "gfn", + "body": "function* ${1:name}(${2:arguments}) {\n\t${0}\n}", + "description": "named generator function (ES6)" + }, + // Iterables + "sequence of 0..n": { + "prefix": "seq", + "body": "[...Array(${1:length}).keys()]${0}", + "description": "sequence of 0..n" + }, + "forEach loop": { + "prefix": "fe", + "body": "${1}.forEach((${2:item}) => {\n\t${0}\n});", + "description": "forEach loop" + }, + "map": { + "prefix": "map", + "body": "${1}.map((${2:item}) => {\n\t${0}\n});", + "description": "map" + }, + "reduce": { + "prefix": "reduce", + "body": "${1}.reduce((${2:previous}, ${3:current}) => {\n\t${0}\n}${4:, initial});", + "description": "reduce" + }, + "filter": { + "prefix": "filter", + "body": "${1}.filter(${2:item} => {\n\t${0}\n});", + "description": "filter" + }, + "find": { + "prefix": "find", + "body": "${1}.find(${2:item} => {\n\t${0}\n});", + "description": "find" + }, + // Objects and Classes + "object literal": { + "prefix": "ol", + "body": "{\n\tkv${0}\n};", + "description": "object literal" + }, + "same-line object literal": { + "prefix": "slol", + "body": "{ kv${0} };", + "description": "same-line object literal" + }, + "key/value pair": { + "prefix": "kv", + "body": "${1:key}: ${2:value},", + "description": "key/value pair" + }, + "class (ES6)": { + "prefix": "c", + "body": "class ${1:name} {\n\tconstructor(${2:arguments}) {\n\t\t${0}\n\t}\n}", + "description": "class (ES6)" + }, + "child class (ES6)": { + "prefix": "cex", + "body": "class ${1:name} extends ${2:base} {\n\tconstructor(${3:arguments}) {\n\t\tsuper(${3:arguments});\n\t\t${0}\n\t}\n}", + "description": "child class (ES6)" + }, + "class constructor (ES6)": { + "prefix": "ctor", + "body": "constructor(${1:arguments}) {\n\tsuper(${1:arguments});${0}\n}", + "description": "class constructor (ES6)" + }, + "method (ES6 syntax)": { + "prefix": "m", + "body": "${1:method}(${2:arguments}) {\n\t${0}\n}", + "description": "method (ES6 syntax)" + }, + "getter (ES6 syntax)": { + "prefix": "get", + "body": "get ${1:property}() {\n\t${0}\n}", + "description": "getter (ES6 syntax)" + }, + "setter (ES6 syntax)": { + "prefix": "set", + "body": "set ${1:property}(${2:value}) {\n\t${0}\n}", + "description": "setter (ES6 syntax)" + }, + "getter and setter (ES6 syntax)": { + "prefix": "gs", + "body": "get ${1:property}() {\n\t${0}\n}\nset ${1:property}(${2:value}) {\n\t\n}", + "description": "getter and setter (ES6 syntax)" + }, + "prototypal constructor": { + "prefix": "pctor", + "body": "var ${1:Class} = function(${2:arguments}) {\n\t${0}\n};", + "description": "prototypal constructor" + }, + "prototype method": { + "prefix": "proto", + "body": "${1:Class}.prototype.${2:method} = function(${3:arguments}) {\n\t${0}\n};", + "description": "prototype method" + }, + "Object.assign": { + "prefix": "oa", + "body": "Object.assign(${1:dest}, ${2:source})", + "description": "Object.assign" + }, + "Object.assign copy (shallow clone)": { + "prefix": "oc", + "body": "Object.assign({}, ${1:original}, ${2:source})", + "description": "Object.assign copy (shallow clone)" + }, + // Returning values + "return": { + "prefix": "r", + "body": "return ${0};", + "description": "return" + }, + "return Promise (ES6)": { + "prefix": "rp", + "body": "return new Promise((resolve, reject) => {\n\t${0}\n});", + "description": "return Promise (ES6)" + }, + "return complex value (such as JSX components)": { + "prefix": "rc", + "body": "return (\n\t${0}\n);", + "description": "return complex value (such as JSX components)" + }, + // Types + "typeof": { + "prefix": "tof", + "body": "typeof ${1:source} === '${2:undefined}'", + "description": "typeof" + }, + "instanceof": { + "prefix": "iof", + "body": "${1:source} instanceof ${2:Object}", + "description": "instanceof" + }, + // Promises + "Promise (ES6)": { + "prefix": "pr", + "body": "new Promise((resolve, reject) => {\n\t${0}\n})", + "description": "Promise (ES6)" + }, + "Promise.then": { + "prefix": "then", + "body": "${1:promise}.then((${2:value}) => {\n\t${0}\n})", + "description": "Promise.then" + }, + "Promise.catch": { + "prefix": "catch", + "body": "${1:promise}.catch((${2:err}) => {\n\t${0}\n})", + "description": "Promise.catch" + }, + // ES6 Modules + "export (ES6)": { + "prefix": "ex", + "body": "export ${1:member};", + "description": "export (ES6)" + }, + "export default (ES6)": { + "prefix": "exd", + "body": "export default ${1:member};", + "description": "export default (ES6)" + }, + "import module (ES6)": { + "prefix": "im", + "body": "import ${1:*} from '${2:module}';", + "description": "import module (ES6)" + }, + "import module as (ES6)": { + "prefix": "ima", + "body": "import ${1:*} as ${2:name} from '${3:module}';", + "description": "import module as (ES6)" + }, + // Node.js + "Node.js style callback": { + "prefix": "cb", + "body": "(err, ${1:value}) => {${0}}", + "description": "Node.js style callback" + }, + "require": { + "prefix": "re", + "body": "require('${1:module}');", + "description": "require" + }, + "require local": { + "prefix": "rel", + "body": "require('./${1:module}');", + "description": "require local" + }, + "require assignment": { + "prefix": "req", + "body": "const ${1:module} = require('${1:module}');", + "description": "require assignment" + }, + "require assignment local": { + "prefix": "reql", + "body": "const ${1:module} = require('./${1:module}');", + "description": "require assignment local" + }, + "destructuring require assignment": { + "prefix": "dreq", + "body": "const {${1:module}} = require('${1:module}');", + "description": "destructuring require assignment" + }, + "destructuring require assignment local": { + "prefix": "dreql", + "body": "const {${1:module}} = require('./${1:module}');", + "description": "destructuring require assignment local" + }, + "exports.member": { + "prefix": "em", + "body": "exports.${1:member} = ${2:value};", + "description": "exports.member" + }, + "module.exports": { + "prefix": "me", + "body": "module.exports = ${1:name};", + "description": "module.exports" + }, + "module exports object": { + "prefix": "meo", + "body": "module.exports = {\n\t${1:member}\n};", + "description": "module exports object" + }, + "event handler": { + "prefix": "on", + "body": "${1:emitter}.on('${2:event}', (${3:arguments}) => {\n\t${0}\n});", + "description": "event handler" + }, + // BDD Testing (Mocha, Jasmine, etc.) + "describe": { + "prefix": "desc", + "body": "describe('${1:description}', () => {\n\t${0}\n});", + "description": "describe" + }, + "context": { + "prefix": "cont", + "body": "context('${1:description}', () => {\n\t${0}\n});", + "description": "context" + }, + "it": { + "prefix": "it", + "body": "it('${1:description}', () => {\n\t${0}\n});", + "description": "it" + }, + "it synchronous": { + "prefix": "its", + "body": "it('${1:description}', () => {\n\t${0}\n});", + "description": "it synchronous" + }, + "it asynchronous": { + "prefix": "ita", + "body": "it('${1:description}', (done) => {\n\t${0}\n\tdone();\n});", + "description": "it asynchronous" + }, + "before test suite": { + "prefix": "bf", + "body": "before(() => {\n\t${0}\n});", + "description": "before test suite" + }, + "before each test": { + "prefix": "bfe", + "body": "beforeEach(() => {\n\t${0}\n});", + "description": "before each test" + }, + "after test suite": { + "prefix": "aft", + "body": "after(() => {\n\t${0}\n});", + "description": "after test suite" + }, + "after each test": { + "prefix": "afe", + "body": "afterEach(() => {\n\t${0}\n});", + "description": "after each test" + }, + // Console + "console.log": { + "prefix": "cl", + "body": "console.log(${0});", + "description": "console.log" + }, + "console.error": { + "prefix": "ce", + "body": "console.error(${0});", + "description": "console.error" + }, + "console.warn": { + "prefix": "cw", + "body": "console.warn(${0});", + "description": "console.warn" + }, + "console.log labeled": { + "prefix": "cll", + "body": "console.log('${0}', ${0});", + "description": "console.log labeled" + }, + "console.error labeled": { + "prefix": "cel", + "body": "console.error('${0}', ${0});", + "description": "console.error labeled" + }, + "console.warn labeled": { + "prefix": "cwl", + "body": "console.warn('${0}', ${0});", + "description": "console.warn labeled" + }, + // Timers + "setTimeout": { + "prefix": "st", + "body": "setTimeout(() => {\n\t${0}\n}, ${1:delay});", + "description": "setTimeout" + }, + "setInterval": { + "prefix": "si", + "body": "setInterval(() => {\n\t${0}\n}, ${1:delay});", + "description": "setInterval" + }, + "setImmediate": { + "prefix": "sim", + "body": "setImmediate(() => {\n\t${0}\n});", + "description": "setImmediate" + }, + "process nextTick": { + "prefix": "nt", + "body": "process.nextTick(() => {\n\t${0}\n});", + "description": "process nextTick" + }, + // Miscellaneous + "insert 'use strict' statement": { + "prefix": "us", + "body": "'use strict';", + "description": "insert 'use strict' statement" + } +} \ No newline at end of file diff --git a/snippets/snippets.json b/snippets/omi.json similarity index 93% rename from snippets/snippets.json rename to snippets/omi.json index ea72953..e8070cb 100644 --- a/snippets/snippets.json +++ b/snippets/omi.json @@ -128,5 +128,12 @@ "" ], "description": "Scaffold