-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjetbrains.py
33 lines (28 loc) · 1 KB
/
jetbrains.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
from talon.voice import Context, Key
ides = ['com.jetbrains.PhpStorm', 'com.jetbrains.intellij']
ctx = Context('phpstorm', func=lambda app, win: any(
i in app.bundle for i in ides))
keymap = {
'comment declaration': ['/**', Key('space')],
'comment block': ['/**', Key('enter')],
# annotation command
'(next tab | goneck)': Key('cmd-shift-['),
'(last tab | gopreev)': Key('cmd-shift-]'),
'last file': Key('ctrl-tab'),
'jolt': Key('cmd-d'),
'comply': Key('tab'),
'import class': Key('alt-enter enter'),
'quickfix': Key('alt-enter'),
'go class': Key('cmd-o'),
'go file': Key('cmd-shift-o'),
'(go implement | go definition)': Key('cmd-b'),
'preev method': Key('ctrl-up'),
'neck method': Key('ctrl-down'),
'refactor': Key('shift-f6'),
'generate': Key('cmd-n'),
'recent': Key('cmd-e'),
'trundle': Key('cmd-/'),
'(fix imports | remove unused imports)': Key('ctrl-alt-o'),
'complete [statement]': Key('cmd-shift-enter'),
}
ctx.keymap(keymap)