forked from derickc/Fountainhead
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefault (Linux).sublime-keymap
399 lines (350 loc) · 20.7 KB
/
Default (Linux).sublime-keymap
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
[
// Press space twice to move outside of brackets and parentheses
// { "keys": [" "," "], "command": "move", "args": {"by": "characters", "forward": true}, "context":
// [
// { "key": "following_text", "operator": "regex_contains", "operand": "^[)};'>\"\\]]", "match_all": true },
// { "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true }
// ]
// },
// Override normal ctrl+enter (insert a blank line)
{ "keys": ["ctrl+enter"], "command": "insert", "args": {"characters": "\n"}, "context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true }
]
},
// Press Shift + Space to move the cursor forward
{ "keys": ["shift+space"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
// { "key": "following_text", "operator": "regex_contains", "operand": "^[)};'>\"\\]]", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.forward_cursor", "operator": "equal", "operand": true}
// sublime.load_settings('Fountainhead.sublime-settings').get('auto_save', True)
]
},
// Press Tab to move outside of notes, parentheticals/parentheses, quotes, and underlined/italic/bold text
{ "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
{ "key": "following_text", "operator": "regex_contains", "operand": "^[])_*\"]", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.forward_cursor", "operator": "equal", "operand": true}
]},
// Show Character List
{ "keys": ["tab"], "command": "insert", "args": {"characters": "\n"},
"context":
[
{ "key": "popup_visible", "operator": "equal", "operand": true },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.characters", "operator": "equal", "operand": true}
]
},
// Show Character List
{ "keys": ["super+shift+c"], "command": "show_characters",
"context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.characters", "operator": "equal", "operand": true}
]
},
// Show Scene List
{ "keys": ["super+shift+s"], "command": "show_scenes",
"context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.scenes", "operator": "equal", "operand": true}
]
},
// Show and Hide Boneyard, Synopses, and Notes
// Toggles Boneyard
{ "keys": ["ctrl+k", "ctrl+/"], "command": "hide_boneyard",
"context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.fold_text", "operator": "equal", "operand": true}
]
},
// Toggle Synopses
{ "keys": ["ctrl+k", "ctrl+="], "command": "hide_synopses",
"context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.fold_text", "operator": "equal", "operand": true}
] },
// Toggle Notes
{ "keys": ["ctrl+k", "ctrl+["], "command": "hide_notes",
"context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.fold_text", "operator": "equal", "operand": true}
] },
// Capitalize character names and minor scene headings; doesn't capitalize notes and comments.
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/CapLine.sublime-macro"},
"context":
[
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "variable.parameter", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "comment", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
// Automatically insert blank lines where appropriate
// Insert a blank line after a Dialogue and action text.
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/DoubleReturn.sublime-macro"},
"context":
[
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "[]|!|.|?|_|;|,|:|/|*|\"|-][ ]*[\t]*$"},
{ "key": "selector", "operator": "not_equal", "operand": "variable.parameter", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "comment", "match_all": true },
{ "key": "setting.auto_line", "operator": "equal", "operand": true}
]
},
// Move the cursor down a line (Same as pressing the down arrow)
{ "keys": ["shift+enter"], "command": "move", "args": {"by": "lines", "forward": true},
"context":
[
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.auto_line", "operator": "equal", "operand": true}
]
},
// Insert a blank line after a transition
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/DoubleReturn.sublime-macro"},
"context":
[
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "^[ \t]*=|^[ \t]*#|^[ \t]*~|^[ \t]*!"},
{ "key": "setting.auto_line", "operator": "equal", "operand": true}
]
},
// Insert a blank line after centered text
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/DoubleReturn.sublime-macro"},
"context":
[
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "<[ \t]*$"},
{ "key": "setting.auto_line", "operator": "equal", "operand": true}
]
},
// Single return within Title Page scope
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/SingleReturn.sublime-macro"},
"context":
[
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "^format[:]|^Format[:]|^title[:]|^Title[:]|^credit[:]|^Credit[:]|^authors[:]|^Authors[:]|^author[:]|^Author[:]|^source[:]|^Source[:]|^draft date[:]|^Draft Date[:]|^Draft date[:]|^contact[:]|^Contact[:]|^copyright[:]|^Copyright[:]|^notes[:]|^Notes[:]"},
{ "key": "setting.auto_line", "operator": "equal", "operand": true}
]
},
// Single return when cursor is on a blank line
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/SingleReturn.sublime-macro"},
"context":
[
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "^$"},
{ "key": "setting.auto_line", "operator": "equal", "operand": true}
]
},
// Single return when line starts with @ for Character name
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/SingleReturn.sublime-macro"},
"context":
[
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "^[ \t]*[@]"},
{ "key": "setting.auto_line", "operator": "equal", "operand": true}
]},
// Single return when line starts with ! for Action
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/SingleReturn.sublime-macro"},
"context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "^[ \t]*[!]"},
{ "key": "setting.auto_line", "operator": "equal", "operand": true}
]},
// Single return when line starts with ~ for Lyrics dialogue
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/SingleReturn.sublime-macro"},
"context":
[
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "^[ \t]*[~]"},
{ "key": "setting.auto_line", "operator": "equal", "operand": true}
]
},
//Capitalize and skip two spaces for transition ":" or slugline that ends in ":"
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/CapScene.sublime-macro"},
"context":
[
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": " [Tt][Oo][:]$"},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
// Don't capitalize line if cursor is inside or outside of parentheticals.
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/Add Line.sublime-macro"},
"context":
[
{ "key": "following_text", "operator": "text", "operator": "regex_contains", "operand": "^[)]$", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/Add Line.sublime-macro"},
"context":
[
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "[)]$", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
// Don't capitalize line and add single return if cursor is inside or outside notes.
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/Add Line.sublime-macro"},
"context":
[
{ "key": "following_text", "operator": "text", "operator": "regex_contains", "operand": "^[]][]]$", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/Add Line.sublime-macro"},
"context":
[
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "[]][]]$", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
// Don't capitalize line and add single return if cursor is inside or outside comments.
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/Add Line.sublime-macro"},
"context":
[
{ "key": "following_text", "operator": "text", "operator": "regex_contains", "operand": "[*][\/]$", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/Add Line.sublime-macro"},
"context":
[
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "[*][\/]$", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
// Capitalize lines that end in parenthese but have text before them (characters and scene headings)
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/CapLineParentheses.sublime-macro"},
"context":
[
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": ".+[(].*[)]", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "following_text", "operator": "text", "operator": "regex_contains", "operand": ".*[)]$", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
// { "key": "selector", "operator": "not_equal", "operand": "foreground", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/CapLine.sublime-macro"},
"context":
[
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": ".+[(].*[)]$", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
// @ Character names that include parenthese have the text within the parenthese capitalized (v.o., o.s., cont'd) but not the character name
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/atCapLineParentheses.sublime-macro"},
"context":
[
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "^[ \t]*@.*[(].*", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/atCapLineParentheses.sublime-macro"},
"context":
[
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "^[ \t]*@.*[(].*[)]$", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]},
//Capitalize Scene Headings
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/CapScene.sublime-macro"},
"context":
[
{ "key": "preceding_text", "operator": "text", "operator": "regex_contains", "operand": "^[ \t]*Int[.]|^[ \t]*Int |^[ \t]*Int/|^[ \t]*Ext/|^[ \t]*EXT/|^[ \t]*ext/|^[ \t]*Ext[.]|^[ \t]*Ext |^[ \t]*I/|^[ \t]*Est[.]|^[ \t]*Est |^[ \t]*INT[.]|^[ \t]*INT |^[ \t]*INT/|^[ \t]*EXT[.]|^[ \t]*EXT |^[ \t]*EST[.]|^[ \t]*EST |^[ \t]*int[.]|^[ \t]*int |^[ \t]*int/|^[ \t]*ext[.]|^[ \t]*ext |^[ \t]*i/|^[ \t]*[.][A-Za-z0-9]|^[ \t]*est[.]|^[ \t]*est |^[ \t]*>|^[ \t]*[_]?[Ff][Ll][Aa][Ss][Hh]"},
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true}
]
},
// Capitalize Scene while inside brackets, but exclude Notes and Comments.
{ "keys": ["enter"], "command": "run_macro_file", "args": {
"file": "Packages/Fountainhead/macros/CapSceneBrackets.sublime-macro"},
"context":
[
{ "key": "following_text", "operator": "text", "operator": "regex_contains", "operand": "[]]$", "match_all": true },
// { "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "variable.parameter", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "comment", "match_all": true },
{ "key": "setting.line_cap", "operator": "equal", "operand": true},
{ "key": "selector", "operator": "not_equal", "operand": "string", "match_all": true }
]
},
// Markdown Text Emphasis
// Wrap _ around selected text
{ "keys": ["_"], "command": "insert_snippet", "args": {"contents": "_${0:$SELECTION}_"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.text_emphasis", "operator": "equal", "operand": true}
]
},
// Wrap [] around selected text
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[${0:$SELECTION}]"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.text_emphasis", "operator": "equal", "operand": true}
]
},
// Wrap * around selected text
{ "keys": ["*"], "command": "insert_snippet", "args": {"contents": "*${0:$SELECTION}*"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text.fountain", "match_all": true },
{ "key": "setting.text_emphasis", "operator": "equal", "operand": true}
]
}
]