-
Notifications
You must be signed in to change notification settings - Fork 0
/
snippets.cson
74 lines (69 loc) · 2.4 KB
/
snippets.cson
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# atom editor snippets
# in open target file type (scope) (Edit|select grammer):
# atom | {alt} View | Developer | Toggle Developer Tools (ctrl+shift+I)
# open developer tools:
# console tab
#?? editor: Log Cursor Scope
# atom.grammers.grammersByScopeName
## expand reported object to see available grammers
# expand js snippet "scope", and paste into the console, changing the final line
# parameter to see what scope(s) are associated with a file extension
# alternate
# atom | {alt} Package | Settings View | Manage Packages | {search} {language}
# {language-{language}} Settings : {language} Grammer; Scope
# text.html.basic
'.text.html.basic':
'head':
'prefix': 'xhead'
'body': """
<meta charset="${1:utf-8}">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>${2:Title Text}</title>$0
"""
'.source.js':
'Scope By Extension':
'prefix': 'scope'
'body': """
(function (ex) {
'use strict';
atom.grammars.grammars.forEach(function (g1) {
g1.fileTypes.forEach(function (f) {
if(f === ex) {
console.log(g1.name, 'is scope', g1.scopeName, 'with extensions', g1.fileTypes);
atom.grammars.grammars.forEach(function (g2) {
g2.includedGrammarScopes.forEach(function (s) {
if (s === g1.scopeName) {
console.log(g2.name, 'scope', g2.scopeName, 'includes', s);
}
});
});
}
});
});
}('${1:fileExtension}'));
"""
'.source.js':
'Lint Header Block':
'prefix': 'lint'
'body': """
/*jslint browser: true, devel: true, indent: 2, maxlen: 82 */
/* jshint bitwise: true, curly: true, eqeqeq: true, es3: false,
forin: true, freeze: true, futurehostile: true, latedef: true,
maxcomplexity: 8, maxstatements: 35, noarg: true, nocomma: true,
noempty: true, nonew: true, singleGroups: true, undef: true, unused: true,
plusplus: true, strict: true, browser: true, devel: true
*/
/*global net */
"""
'.source.js':
'Function comment header':
'prefix': 'head'
'body': """
/**
* ${1:function purpose}
*
* @param {${2:data type}} ${3:parameter name} ${4:parameter description}
* @return {${5:data type}}
*/$0
"""