forked from dopey/talon_user
-
Notifications
You must be signed in to change notification settings - Fork 0
/
symbol.py
101 lines (90 loc) · 2.92 KB
/
symbol.py
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
from talon.voice import Context, Key
ctx = Context('symbol')
keymap = {
'randall': Key('esc'),
'(question [mark] | questo)': '?',
'(minus | dash)': '-',
'plus': '+',
'tilde': '~',
'(bang | exclamation point | clamor)': '!',
'(dollar [sign] | dolly)': '$',
'(downscore | crunder)': '_',
'(semi | semicolon | sunk)': ';',
'colon': ':',
'(square | left square [bracket] | brackorp)': '[',
'(rsquare | are square | right square [bracket] | brackose)': ']',
'(paren | left paren)': '(',
'(rparen | are paren | right paren)': ')',
'(brace | left brace | kirksorp)': '{',
'(rbrace | are brace | right brace | kirkos)': '}',
'(angle | left angle | less than)': '<',
'(rangle | are angle | right angle | greater than)': '>',
'(star | asterisk)': '*',
'(pound | hash [sign] | octo | thorpe | number sign)': '#',
'percent [sign]': '%',
'caret': '^',
'at sign': '@',
'(and sign | ampersand | amper)': '&',
'spike': '|',
'(dubquote | double quote | quatches)': '"',
'(quote | quatchet)': "'",
'triple quote': "'''",
'tick': "`",
'triple tick': "```",
'(dot | period)': '.',
'comma': ',',
'comshock': [',', Key('enter')],
'swipe': ', ',
'coalgap': ': ',
'skoosh': ' ',
'[forward] slash': '/',
'[forward] slasher': '// ',
'[forward] dubslash': '//',
'backslash': '\\',
'coalshock': [':', Key('enter')],
'coal twice': '::',
'ellipsis': '...',
'mintwice': '--',
'plustwice': '++',
# equality
'coleek': ' := ',
'empty dict': '{}',
'minquall': '-=',
'pluqual': '+=',
'starqual': '*=',
'lessqual': ' <= ',
'grayqual': ' >= ',
'smaqual': '=',
'equeft': ' = ',
'([is] equal to | longqual)': ' == ',
'([is] not equal to | banquall)': ' != ',
'trickle': ' === ',
'(ranqual | nockle)': ' !== ',
'(arrow | lambo)': ' -> ',
'shrocket': ' => ',
'sinker': [Key('cmd-right ;')],
# surrounders
'(empty array | brackers)': '[]',
'brax-block': ['[', Key('enter')],
'(call | prekris)': '()',
'prex-block': ['(', Key('enter')],
'angler': ['<>', Key('left')],
'brax': ['[]', Key('left')],
'coif': ['""', Key('left')],
'glitch': ['``', Key('left')],
'kirk': ['{}', Key('left')],
'precoif': ['("")', Key('left'), Key('left')],
'prex': ['()', Key('left')],
'posh': ["''", Key('left')],
#'padded': (False, surround(" "), 1),
'and sign': '&',
'(dot dot | dotdot | doodle)': '..',
'(enter | shock)': Key('enter'),
'junk': Key('backspace'),
'junk 2': [Key('backspace'), Key('backspace')],
'junk 3': [Key('backspace'), Key('backspace'), Key('backspace')],
'junk 4': [Key('backspace'), Key('backspace'), Key('backspace'), Key('backspace')],
'junk 5': [Key('backspace'), Key('backspace'), Key('backspace'), Key('backspace'), Key('backspace')],
'spunk': Key('delete'),
}
ctx.keymap(keymap)