Skip to content

Commit cf5c011

Browse files
committed
Fix our snippets to be text mate compatible
1 parent 613dd2e commit cf5c011

8 files changed

Lines changed: 193 additions & 258 deletions

File tree

extensions/css/snippets/css.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,28 @@
22
"transition property": {
33
"prefix": "transition",
44
"body": [
5-
"-webkit-transition: ${property} ${duration} ${timing-function} ${delay};",
6-
"-moz-transition: ${property} ${duration} ${timing-function} ${delay};",
7-
"transition: ${property} ${duration} ${timing-function} ${delay};"
5+
"-webkit-transition: ${1:property} ${2:duration} ${3:timing-function} ${4:delay};",
6+
"-moz-transition: ${1:property} ${2:duration} ${3:timing-function} ${4:delay};",
7+
"transition: ${1:property} ${2:duration} ${3:timing-function} ${4:delay};"
88
],
99
"description": "The transition property across browsers"
1010
},
1111
"border": {
1212
"prefix": "border",
1313
"body": [
14-
"border: ${width} ${border-style} ${color};$0"
14+
"border: ${1:width} ${2:border-style} ${3:color};$0"
1515
],
1616
"description": "[width] [border-style] [color]"
1717
},
1818
"gradient": {
1919
"prefix": "gradient",
2020
"body": [
21-
"background-image: -webkit-gradient(linear, left top, left bottom, from(${start-color}), to(${end-color}));",
22-
"background-image: -webkit-linear-gradient(top, ${start-color}, ${end-color});",
23-
"background-image: -moz-linear-gradient(top, ${start-color}, ${end-color});",
24-
"background-image: linear-gradient(to bottom, ${start-color}, ${end-color});"
21+
"background-image: -webkit-gradient(linear, left top, left bottom, from(${1:start-color}), to(${2:end-color}));",
22+
"background-image: -webkit-linear-gradient(top, ${1:start-color}, ${2:end-color});",
23+
"background-image: -moz-linear-gradient(top, ${1:start-color}, ${2:end-color});",
24+
"background-image: linear-gradient(to bottom, ${1:start-color}, ${2:end-color});"
2525
],
2626
"description": "Set the 'background-image' property to a linear gradient"
2727
}
2828
}
29+

extensions/javascript/snippets/javascript.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"body": [
55
"define([",
66
"\t'require',",
7-
"\t'${dependency}'",
8-
"], function(require, ${factory}) {",
7+
"\t'${1:dependency}'",
8+
"], function(require, ${2:factory}) {",
99
"\t'use strict';",
1010
"\t$0",
1111
"});"
@@ -15,8 +15,8 @@
1515
"For Loop": {
1616
"prefix": "for",
1717
"body": [
18-
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {",
19-
"\tvar ${element} = ${array}[${index}];",
18+
"for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
19+
"\tvar ${3:element} = ${2:array}[${1:index}];",
2020
"\t$0",
2121
"}"
2222
],
@@ -25,7 +25,7 @@
2525
"For-Each Loop": {
2626
"prefix": "foreach",
2727
"body": [
28-
"${array}.forEach(function(${element}) {",
28+
"${1:array}.forEach(function(${2:element}) {",
2929
"\t$0",
3030
"}, this);"
3131
],
@@ -34,9 +34,9 @@
3434
"For-In Loop": {
3535
"prefix": "forin",
3636
"body": [
37-
"for (var ${key} in ${object}) {",
38-
"\tif (${object}.hasOwnProperty(${key})) {",
39-
"\t\tvar ${element} = ${object}[${key}];",
37+
"for (var ${1:key} in ${2:object}) {",
38+
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
39+
"\t\tvar ${3:element} = ${2:object}[${1:key}];",
4040
"\t\t$0",
4141
"\t}",
4242
"}"
@@ -46,7 +46,7 @@
4646
"Function Statement": {
4747
"prefix": "function",
4848
"body": [
49-
"function ${name}(${params}) {",
49+
"function ${1:name}(${2:params}) {",
5050
"\t$0",
5151
"}"
5252
],
@@ -55,7 +55,7 @@
5555
"If Statement": {
5656
"prefix": "if",
5757
"body": [
58-
"if (${condition}) {",
58+
"if (${1:condition}) {",
5959
"\t$0",
6060
"}"
6161
],
@@ -64,7 +64,7 @@
6464
"If-Else Statement": {
6565
"prefix": "ifelse",
6666
"body": [
67-
"if (${condition}) {",
67+
"if (${1:condition}) {",
6868
"\t$0",
6969
"} else {",
7070
"\t",
@@ -75,15 +75,15 @@
7575
"New Statement": {
7676
"prefix": "new",
7777
"body": [
78-
"var ${name} = new ${type}(${arguments});$0"
78+
"var ${1:name} = new ${2:type}(${3:arguments});$0"
7979
],
8080
"description": "New Statement"
8181
},
8282
"Switch Statement": {
8383
"prefix": "switch",
8484
"body": [
85-
"switch (${key}) {",
86-
"\tcase ${value}:",
85+
"switch (${1:key}) {",
86+
"\tcase ${2:value}:",
8787
"\t\t$0",
8888
"\t\tbreak;",
8989
"",
@@ -96,7 +96,7 @@
9696
"While Statement": {
9797
"prefix": "while",
9898
"body": [
99-
"while (${condition}) {",
99+
"while (${1:condition}) {",
100100
"\t$0",
101101
"}"
102102
],
@@ -107,16 +107,16 @@
107107
"body": [
108108
"do {",
109109
"\t$0",
110-
"} while (${condition});"
110+
"} while (${1:condition});"
111111
],
112112
"description": "Do-While Statement"
113113
},
114-
"Try-Catch Statement":{
114+
"Try-Catch Statement": {
115115
"prefix": "trycatch",
116116
"body": [
117117
"try {",
118118
"\t$0",
119-
"} catch (${error}) {",
119+
"} catch (${1:error}) {",
120120
"\t",
121121
"}"
122122
],
@@ -127,7 +127,7 @@
127127
"body": [
128128
"setTimeout(function() {",
129129
"\t$0",
130-
"}, ${timeout});"
130+
"}, ${1:timeout});"
131131
],
132132
"description": "Set Timeout Function"
133133
},

extensions/javascript/snippets/javascriptreact.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"body": [
55
"define([",
66
"\t'require',",
7-
"\t'${dependency}'",
8-
"], function(require, ${factory}) {",
7+
"\t'${1:dependency}'",
8+
"], function(require, ${2:factory}) {",
99
"\t'use strict';",
1010
"\t$0",
1111
"});"
@@ -15,8 +15,8 @@
1515
"For Loop": {
1616
"prefix": "for",
1717
"body": [
18-
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {",
19-
"\tvar ${element} = ${array}[${index}];",
18+
"for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
19+
"\tvar ${3:element} = ${2:array}[${1:index}];",
2020
"\t$0",
2121
"}"
2222
],
@@ -25,7 +25,7 @@
2525
"For-Each Loop": {
2626
"prefix": "foreach",
2727
"body": [
28-
"${array}.forEach(function(${element}) {",
28+
"${1:array}.forEach(function(${2:element}) {",
2929
"\t$0",
3030
"}, this);"
3131
],
@@ -34,9 +34,9 @@
3434
"For-In Loop": {
3535
"prefix": "forin",
3636
"body": [
37-
"for (var ${key} in ${object}) {",
38-
"\tif (${object}.hasOwnProperty(${key})) {",
39-
"\t\tvar ${element} = ${object}[${key}];",
37+
"for (var ${1:key} in ${2:object}) {",
38+
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
39+
"\t\tvar ${3:element} = ${2:object}[${1:key}];",
4040
"\t\t$0",
4141
"\t}",
4242
"}"
@@ -46,7 +46,7 @@
4646
"Function Statement": {
4747
"prefix": "function",
4848
"body": [
49-
"function ${name}(${params}) {",
49+
"function ${1:name}(${2:params}) {",
5050
"\t$0",
5151
"}"
5252
],
@@ -55,7 +55,7 @@
5555
"If Statement": {
5656
"prefix": "if",
5757
"body": [
58-
"if (${condition}) {",
58+
"if (${1:condition}) {",
5959
"\t$0",
6060
"}"
6161
],
@@ -64,7 +64,7 @@
6464
"If-Else Statement": {
6565
"prefix": "ifelse",
6666
"body": [
67-
"if (${condition}) {",
67+
"if (${1:condition}) {",
6868
"\t$0",
6969
"} else {",
7070
"\t",
@@ -75,15 +75,15 @@
7575
"New Statement": {
7676
"prefix": "new",
7777
"body": [
78-
"var ${name} = new ${type}(${arguments});$0"
78+
"var ${1:name} = new ${2:type}(${3:arguments});$0"
7979
],
8080
"description": "New Statement"
8181
},
8282
"Switch Statement": {
8383
"prefix": "switch",
8484
"body": [
85-
"switch (${key}) {",
86-
"\tcase ${value}:",
85+
"switch (${1:key}) {",
86+
"\tcase ${2:value}:",
8787
"\t\t$0",
8888
"\t\tbreak;",
8989
"",
@@ -96,7 +96,7 @@
9696
"While Statement": {
9797
"prefix": "while",
9898
"body": [
99-
"while (${condition}) {",
99+
"while (${1:condition}) {",
100100
"\t$0",
101101
"}"
102102
],
@@ -107,16 +107,16 @@
107107
"body": [
108108
"do {",
109109
"\t$0",
110-
"} while (${condition});"
110+
"} while (${1:condition});"
111111
],
112112
"description": "Do-While Statement"
113113
},
114-
"Try-Catch Statement":{
114+
"Try-Catch Statement": {
115115
"prefix": "trycatch",
116116
"body": [
117117
"try {",
118118
"\t$0",
119-
"} catch (${error}) {",
119+
"} catch (${2:error}) {",
120120
"\t",
121121
"}"
122122
],
@@ -127,7 +127,7 @@
127127
"body": [
128128
"setTimeout(function() {",
129129
"\t$0",
130-
"}, ${timeout});"
130+
"}, ${1:timeout});"
131131
],
132132
"description": "Set Timeout Function"
133133
},
Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,71 @@
11
{
2-
32
"Insert bold text": {
43
"prefix": "bold",
5-
"body": "**${text}**${}",
4+
"body": "**${1:text}**${}",
65
"description": "Insert bold text"
76
},
8-
97
"Insert italic text": {
108
"prefix": "italic",
11-
"body": "*${text}*${}",
9+
"body": "*${1:text}*${}",
1210
"description": "Insert italic text"
1311
},
14-
1512
"Insert quoted text": {
1613
"prefix": "quote",
17-
"body": "> ${text}",
14+
"body": "> ${1:text}",
1815
"description": "Insert quoted text"
1916
},
20-
2117
"Insert code": {
2218
"prefix": "code",
23-
"body": "`${text}`${}",
19+
"body": "`${1:text}`${}",
2420
"description": "Insert code"
2521
},
26-
2722
"Insert fenced code block": {
2823
"prefix": "fenced codeblock",
2924
"body": [
30-
"```${language}",
25+
"```${1:language}",
3126
"$0",
3227
"```"
3328
],
3429
"description": "Insert fenced code block"
3530
},
36-
3731
"Insert heading": {
3832
"prefix": "heading",
39-
"body": "# ${text}",
33+
"body": "# ${1:text}",
4034
"description": "Insert heading"
4135
},
42-
4336
"Insert unordered list": {
4437
"prefix": "unordered list",
4538
"body": [
46-
"- ${first}",
47-
"- ${second}",
48-
"- ${third}",
39+
"- ${1:first}",
40+
"- ${2:second}",
41+
"- ${3:third}",
4942
"$0"
5043
],
5144
"description": "Insert unordered list"
5245
},
53-
5446
"Insert ordered list": {
5547
"prefix": "ordered list",
5648
"body": [
57-
"1. ${first}",
58-
"2. ${second}",
59-
"3. ${third}",
49+
"1. ${1:first}",
50+
"2. ${2:second}",
51+
"3. ${3:third}",
6052
"$0"
6153
],
6254
"description": "Insert ordered list"
6355
},
64-
6556
"Insert horizontal rule": {
6657
"prefix": "horizontal rule",
6758
"body": "----------\n",
6859
"description": "Insert horizontal rule"
6960
},
70-
7161
"Insert link": {
7262
"prefix": "link",
73-
"body": "[${text}](http://${link})$0",
63+
"body": "[${1:text}](http://${2:link})$0",
7464
"description": "Insert link"
7565
},
76-
77-
"Insert image" : {
66+
"Insert image": {
7867
"prefix": "image",
79-
"body": "![${alt}](http://${link})$0",
68+
"body": "![${1:alt}](http://${2:link})$0",
8069
"description": "Insert image"
8170
}
82-
}
71+
}

0 commit comments

Comments
 (0)