-
Notifications
You must be signed in to change notification settings - Fork 14
/
FuzzyFilePath.sublime-settings
252 lines (239 loc) · 6.48 KB
/
FuzzyFilePath.sublime-settings
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
{
// set project_directory relative to sublime project directory
"project_directory": "",
// base directory for paths relative to project_directory. Used if scope-trigger contains "base_directory": true
// watch out for side effects with project directory (if base_directory is not within project_directory)
"base_directory": false,
// disable automatic path completions
"disable_autocompletions": false,
// disable keymaps
"disable_keymap_actions": false,
// ignore folders that match following regular expressions
"exclude_folders": ["node_modules", "bower_components"],
// logs scope evaluation to console to debug configuration
"log": false,
// LIST OF TRIGGERS FOR AUTO COMPLETION
// - setting "scopes" in user settings will override all other scopes.
// - create "additional_scopes" in user settings to add more scopes instead.
// they will be added after the existing scopes.
// - triggers are evaluated in given order. First match wins
// - specialize trigger by 1. scope 2. prefix, style and/or tagname
// - command (insert_path) still requires a trigger
"scopes": [
// MINIMAL AUTO TRIGGER - NOT RECOMMENDED
// will always query files for auto completions
// {
// "scope": ".",
// "extensions": ["*"],
// "auto": true
// },
/*
Javascript
*/
{
// js: require()
"scope": "\\.(js|ts)\\s", // 1. ignore if scope at cursor does not match expression (super+alt+p)
"prefix": ["require", "define"], // 2. trigger only if: require(<cursor>, define([<cursor>
// if 1 & 2 are true:
"auto": true,
"relative": true, // insert absolute
"base_directory": false, // insert absolute from the set base directory (above)
"extensions": ["ts", "js", "html", "scss", "json"], // show only .js, .html and .scss files
"replace_on_insert": [
["\\.(js|ts)$", ""], // after insertion, remove .js from path
["([^.])\\/index$", "\\1"], // nodejs will load index.js by default => also remove index
// remove path to module-folder, since our build tool resolves this path automatically
["^([\\/.]+)?\\/(bower_components|node_modules)\\/", ""]
]
},
{
// es6 import from/import "*"
"scope": "string.*\\.(js|ts)\\s",
"auto": true,
"relative": true,
"base_directory": false,
"prefix": ["from", "import"],
"extensions": ["ts", "js", "html", "scss", "json"],
"replace_on_insert": [
["\\.(js|ts)$", ""],
["([^.])\\/index$", "\\1"],
["^([\\/.]+)?\\/(bower_components|node_modules)\\/", ""]
]
},
{
// Typescript // <reference path="" />
"scope": "source\\.ts\\scomment",
"auto": true,
"relative": true,
"base_directory": false,
"prefix": ["path"],
"tagName": ["reference"],
"extensions": ["ts", "js"],
"replace_on_insert": []
},
{
// Typescript es6 import from/import "*"
"scope": "string[^\\s]*\\.ts\\s",
"auto": true,
"relative": true,
"base_directory": false,
"prefix": ["from", "import"],
"extensions": ["js", "ts"],
"replace_on_insert": [
["(\\.js|\\.ts)$", ""],
["([^.])\\/index$", "\\1"],
["^(\\/.+)?\\/(bower_components|node_modules)\\/", ""]
]
},
{
// Coffeescript es6 import from/import "*" and require
"scope": "string[^\\s]*\\.coffee\\s",
"auto": true,
"relative": true,
"base_directory": false,
"prefix": ["from", "import", "require"],
"extensions": ["coffee"],
"replace_on_insert": []
},
{
// js - *.src = ""
"scope": "source\\.js.*string",
"prefix": ["src"],
"auto": true,
"base_directory": true,
"extensions": ["png", "gif", "jpg", "jpeg"],
"relative": true
},
/*
CSS
*/
{
// import ""
"scope": "source\\.(css|sass|scss|less)",
"auto": true,
"prefix": ["import"],
"relative": true,
"extensions": ["css", "sass", "scss", "less"],
"replace_on_insert": [
["\\.(css|scss)$", ""],
["^(\\/.+)?\\/(bower_components|node_modules)\\/", ""]
]
},
{
// *: url()
"scope": "source\\.(css|sass|less)",
"prefix": ["url"],
"auto": true,
"relative": true,
"base_directory": true,
"extensions": ["png", "gif", "jpeg", "jpg", "woff", "ttf", "svg", "otf"],
"replace_on_insert": [
["\\.(css|scss)$", ""],
["^(\\/.+)?\\/(bower_components|node_modules)\\/", ""]
]
},
/*
HTML
*/
{
// html - <script src="..">
"scope": "string\\.quote.*\\.html",
"prefix": ["src"],
"tagName": ["script"],
"auto": true,
"base_directory": false,
"extensions": ["js"],
"relative": true
},
{
// string.quote.double.html
// html - <img src="" and <script src="" and <* style="*: url()
"scope": "text\\.html",
// <* src
"prefix": ["src", "url"],
"auto": true,
"base_directory": true,
"extensions": ["js", "png", "gif", "jpeg", "jpg", "svg"],
"relative": true
},
{
// html - <link href=""
"scope": "meta\\.tag.*string.*\\.html",
// "scope": "html",
// <link href
"tagName": ["link"],
"prefix": ["href"],
"auto": true,
"extensions": ["css"],
"relative": true
},
/*
OTHER
*/
{
// glsl
"scope": "source\\.glsl",
"prefix": ["import"],
"auto": true,
"extensions": ["glsl"],
"relative": true,
"replace_on_insert": [
["\\.glsl$", ""]
]
},
{
// handlebars partial
"scope": "\\.handlebars\\s.*inline",
"auto": true,
"relative": true,
"base_directory": false,
"extensions": ["hbs", "handlebars"],
"replace_on_insert": [
["^(\\/.+)?\\/(bower_components|node_modules)\\/", ""]
]
},
{
// python
"scope": "\\.python",
"extensions": ["py"],
"auto": true,
"prefix": ["from"],
"relative": false,
"replace_on_insert": [
["^\\/", ""],
["\\/", "."],
// ! remove
["^(.*)\\.py$", "FuzzyFilePath.\\1"]
]
},
{
// php
"auto": true,
"scope": "\\.php",
"extensions": ["php"],
"prefix": ["require_once", "include"],
"relative": false,
"replace_on_insert": [["^\\/", ""]]
},
{
// latex \input{}
"scope": "meta\\.include\\.latex",
"prefix": ["input"],
"auto": true,
"relative": true,
"base_directory": false,
"extensions": ["png", "gif", "jpeg", "jpg", "svg"]
},
{
// * - any source file (by command only)
"scope": "source",
"auto": false,
"extensions": ["js", "html", "css", "scss", "less", "png", "gif", "jpeg", "jpg", "svg"],
"relative": true
},
],
"additional_scopes": [
{
}
]
}