Skip to content

Commit 2ff1c7d

Browse files
Merge branch 'rafamadriz:main' into main
2 parents 4aacee7 + 572f566 commit 2ff1c7d

20 files changed

+1680
-1247
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.json]
8+
indent_style = space
9+
indent_size = 4
10+
11+
[*.lua]
12+
indent_style = tab
13+
indent_size = 4
14+
15+
[*.md]
16+
indent_style = space
17+
indent_size = 2
18+
19+
[*.yml]
20+
indent_style = space
21+
indent_size = 2

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@
140140
"language": "rails",
141141
"path": "./snippets/frameworks/rails.json"
142142
},
143+
{
144+
"language": "rspec",
145+
"path": "./snippets/ruby/rspec.json"
146+
},
143147
{
144148
"language": "rust",
145149
"path": "./snippets/rust/rust.json"

snippets/c/c.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -274,67 +274,67 @@
274274
},
275275
"puts": {
276276
"prefix": "puts",
277-
"body": ["puts(\"${1:This function doesn't need newline.}\")$0"],
277+
"body": ["puts(\"${1:This function doesn't need newline.}\");$0"],
278278
"description": "puts() snippet"
279279
},
280280
"fputs": {
281281
"prefix": "fputs",
282-
"body": ["fputs(\"${2:This is a simpler printf.\\n}\", ${1:stdout})$0"],
282+
"body": ["fputs(\"${2:This is a simpler printf.\\n}\", ${1:stdout});$0"],
283283
"description": "puts() snippet"
284284
},
285285
"printf": {
286286
"prefix": "printf",
287-
"body": ["printf(\"${1:%s}\\n\"$2)$0"],
287+
"body": ["printf(\"${1:%s}\\n\"$2);$0"],
288288
"description": "printf() snippet"
289289
},
290290
"fprintf": {
291291
"prefix": "fprintf",
292-
"body": ["fprintf(${1:stderr}, \"${2:%s}\\n\"$3)$0"],
292+
"body": ["fprintf(${1:stderr}, \"${2:%s}\\n\"$3);$0"],
293293
"description": "fprintf() snippet"
294294
},
295295
"sprintf": {
296296
"prefix": "sprintf",
297-
"body": ["sprintf(${1:buf}, \"${2:%s}\\n\"$3)$0"],
297+
"body": ["sprintf(${1:buf}, \"${2:%s}\\n\"$3);$0"],
298298
"description": "sprintf() snippet"
299299
},
300300
"snprintf": {
301301
"prefix": "snprintf",
302-
"body": ["snprintf(${1:buf}, ${2:max}, \"${3:%s}\\n\"$3)$0"],
302+
"body": ["snprintf(${1:buf}, ${2:max}, \"${3:%s}\\n\"$3);$0"],
303303
"description": "snprintf() snippet"
304304
},
305305
"scanf": {
306306
"prefix": "scanf",
307-
"body": ["scanf(\"${1:%d}\"$2)$0"],
307+
"body": ["scanf(\"${1:%d}\"$2);$0"],
308308
"description": "scanf() snippet"
309309
},
310310
"fscanf": {
311311
"prefix": "fscanf",
312-
"body": ["fscanf(${1:stdin}, \"${2:%d}\"$3)$0"],
312+
"body": ["fscanf(${1:stdin}, \"${2:%d}\"$3);$0"],
313313
"description": "fscanf() snippet"
314314
},
315315
"sscanf": {
316316
"prefix": "sscanf",
317-
"body": ["sscanf(${1:buf}, \"${2:%d}\"$3)$0"],
317+
"body": ["sscanf(${1:buf}, \"${2:%d}\"$3);$0"],
318318
"description": "sscanf() snippet"
319319
},
320320
"malloc": {
321321
"prefix": "malloc",
322-
"body": ["malloc(sizeof(${1:int[69]})$2)$0"],
322+
"body": ["malloc(sizeof(${1:int[69]})$2);$0"],
323323
"description": "malloc() snippet"
324324
},
325325
"calloc": {
326326
"prefix": "calloc",
327-
"body": ["calloc(${1:1}, sizeof(${2:int})$3)$0"],
327+
"body": ["calloc(${1:1}, sizeof(${2:int})$3);$0"],
328328
"description": "calloc() snippet"
329329
},
330330
"realloc": {
331331
"prefix": "realloc",
332-
"body": ["realloc(${1:ptr}, sizeof(${2:int[69]})$3)$0"],
332+
"body": ["realloc(${1:ptr}, sizeof(${2:int[69]})$3);$0"],
333333
"description": "realloc() snippet"
334334
},
335335
"reallocarray": {
336336
"prefix": "reallocarray",
337-
"body": ["reallocarray(${1:ptr}, ${2:69}, sizeof(${3:int})$4)$0"],
337+
"body": ["reallocarray(${1:ptr}, ${2:69}, sizeof(${3:int})$4);$0"],
338338
"description": "reallocarray() snippet"
339339
},
340340
"free": {

snippets/cmake.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@
229229
"Set c++ standard": {
230230
"prefix": "cxx",
231231
"body": [
232-
"set(CMAKE_CXX_STANDDARD ${1:14})",
233-
"set(CMAKE_CXX_STANDDARD_REQUIRED ON)"
232+
"set(CMAKE_CXX_STANDARD ${1:14})",
233+
"set(CMAKE_CXX_STANDARD_REQUIRED ON)"
234234
],
235235
"description": "Add the snippet to set c++ standard"
236236
},

snippets/cpp/cpp.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
},
3838
"while": {
3939
"prefix": "while",
40-
"body": ["while ($1) {", "\t$2", "}"],
41-
"description": ""
40+
"body": ["while ($1) {", "\t$0", "}"],
41+
"description": "'while' loop snippet"
4242
},
4343
"foreach": {
4444
"prefix": "foreach",
@@ -269,12 +269,12 @@
269269
"#guard": {
270270
"prefix": "#guard",
271271
"body": [
272-
"#ifndef INCLUDE${TM_DIRECTORY/.*[\\\/](.*)/_${1:/upcase}/}${TM_FILENAME_BASE/(.*)/_${1:/upcase}/}${TM_FILENAME/.*\\.(.*)/_${1:/upcase}/}_",
273-
"#define INCLUDE${TM_DIRECTORY/.*[\\\/](.*)/_${1:/upcase}/}${TM_FILENAME_BASE/(.*)/_${1:/upcase}/}${TM_FILENAME/.*\\.(.*)/_${1:/upcase}/}_",
272+
"#ifndef INCLUDE${TM_DIRECTORY/.*[\\/\\\\](.*)/_${1:/upcase}/}${TM_FILENAME_BASE/(.*)/_${1:/upcase}/}${TM_FILENAME/.*\\.(.*)/_${1:/upcase}/}_",
273+
"#define INCLUDE${TM_DIRECTORY/.*[\\/\\\\](.*)/_${1:/upcase}/}${TM_FILENAME_BASE/(.*)/_${1:/upcase}/}${TM_FILENAME/.*\\.(.*)/_${1:/upcase}/}_",
274274
"",
275275
"$0",
276276
"",
277-
"#endif // INCLUDE${TM_DIRECTORY/.*[\\\/](.*)/_${1:/upcase}/}${TM_FILENAME_BASE/(.*)/_${1:/upcase}/}${TM_FILENAME/.*\\.(.*)/_${1:/upcase}/}_"
277+
"#endif // INCLUDE${TM_DIRECTORY/.*[\\/\\\\](.*)/_${1:/upcase}/}${TM_FILENAME_BASE/(.*)/_${1:/upcase}/}${TM_FILENAME/.*\\.(.*)/_${1:/upcase}/}_"
278278
],
279279
"description": "header guard. format :\n\tINCLUDE_<dirname>_<filename>_<extension>_"
280280
},

snippets/csharp/csharp.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,17 @@
5252
"Console.WriteLine": {
5353
"prefix": "cw",
5454
"body": [
55-
"System.Console.WriteLine($0);"
55+
"Console.WriteLine($0);"
5656
],
5757
"description": "Console.WriteLine"
5858
},
59+
"Console.ReadLine": {
60+
"prefix": "cr",
61+
"body": [
62+
"Console.ReadLine($0);"
63+
],
64+
"description": "Console.ReadLine"
65+
},
5966
"do...while loop": {
6067
"prefix": "do",
6168
"body": [

snippets/erb.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,19 @@
5656
"body": ["<%= $1 %>"],
5757
"description": "render block pe"
5858
},
59+
"comment": {
60+
"prefix": ["pc"],
61+
"body": ["<%# $1 %>"],
62+
"description": "erb print comment"
63+
},
5964
"exec": {
6065
"prefix": ["er", "%"],
6166
"body": ["<% $1 %>"],
6267
"description": "erb exec block"
68+
},
69+
"link_to": {
70+
"prefix": ["lt"],
71+
"body": ["<%= link_to $1, $2 %>"],
72+
"description": "link_to helper"
6373
}
6474
}

snippets/global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"copyright": {
3-
"prefix": "c)",
3+
"prefix": "copyright",
44
"body": [
55
"Copyright (c) ${CURRENT_YEAR} ${0:Author}. All Rights Reserved."
66
],

snippets/haskell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
},
107107
"lambda": {
108108
"prefix": ["\\", "lambda"],
109-
"body": ["\\${1:x} -> ${2:undefined}$0"],
109+
"body": ["\\\\${1:x} -> ${2:undefined}$0"],
110110
"description": "lambda function"
111111
},
112112
"pragma": {

snippets/html.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
{
2+
"!": {
3+
"prefix": "!",
4+
"body": [
5+
"<!DOCTYPE html>",
6+
"<html lang=\"$1en\">",
7+
"<head>",
8+
"\t<meta charset=\"UTF-8\">",
9+
"\t<meta name=\"viewport\" content=\"width=${2:device-width}, initial-scale=${3:1.0}\">",
10+
"\t<title>${5:Document}</title>",
11+
"</head>",
12+
"<body>",
13+
"\t${6}",
14+
"</body>",
15+
"</html>"
16+
],
17+
"description": "HTML - Defines a template for a html5 document",
18+
"scope": "text.html"
19+
},
220
"doctype": {
321
"prefix": "doctype",
422
"body": ["<!DOCTYPE>", "$1"],
@@ -309,12 +327,12 @@
309327
"prefix": "html5",
310328
"body": [
311329
"<!DOCTYPE html>",
312-
"<html lang=\"$1en\">",
330+
"<html lang=\"${1:en}\">",
313331
"\t<head>",
314332
"\t\t<meta charset=\"UTF-8\">",
315333
"\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">",
316334
"\t\t<title>$2</title>",
317-
"\t\t<link href=\"$3css/style.css\" rel=\"stylesheet\">",
335+
"\t\t<link href=\"${3:css/style.css}\" rel=\"stylesheet\">",
318336
"\t</head>",
319337
"\t<body>",
320338
"\t$0",

0 commit comments

Comments
 (0)