-
Notifications
You must be signed in to change notification settings - Fork 0
/
visualstudio.py
106 lines (93 loc) · 4.45 KB
/
visualstudio.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
102
103
104
105
106
#imports the library
from dragonfly import (Grammar, AppContext, MappingRule, Integer, Key, Text, Dictation, Choice, Pause)
class VisualStudioMappings(MappingRule):
mapping = {
# temp
'Add navigation': Text('~/Views/Navigation/Header/Navigation'),
'Add header': Text('~/Views/Navigation/Header'),
'Add Extension': Text('.cshtml'),
# Bookmarks
'book <number>': Key("c-%(number)s"),
'book <number> snap': Key("cs-%(number)s"),
'book view': Key("c-`,"),
# Navigation
'snurch': Key("cs-f"),
'goat death': Key('c-f12'),
'peak death': Key('a-f12'),
'view recent': Key('c-comma'),
'view edits': Key('cs-comma'),
'line <number>': Key("c-g") + Text("%(number)s") + Key("enter,end"),
'close all': Key("a-minus")+ Pause('50') + Key('a'),
'close pinned': Key("a-minus")+ Pause('50') + Key('down:6, enter'),
'pin tab': Key("a-minus")+ Pause('50') + Key('p'),
'save all': Key("cs-s"),
'delete line': Key("s-delete"),
'Sink dock': Key("c-[,s"),
'goat': Key("c-t"),
'X open': Key("ca-l"),
'PM open': Key("alt,t,n,o"),
'tab select': Key('ctrl:down,tab'),
'pick <number>': Key('down:%(number)s, enter, ctrl:up'),
# Debugging
'step in': Key('f5'),
'step over': Key('f10'),
'step out': Key("s-f11"),
'Break snap': Key("f9"),
'Break view': Key("ca-b"),
'Run it': Key("f5"),
'Attach <number>': Key("c-r,c-%(number)s"),
'watch <number>': Key('ca-w,%(number)s'),
'tests run': Key('c-r,c-t'),
'test debug': Key('c-u,c-d'),
'Blossom': Key("cs-b"),
'blessed load': Key("cs-b") + Pause('800') + Key('w-4') + Pause('50') + Key('c-1,f5') + Pause('50') + Key('w-6'),
'Load web': Key('w-4') + Pause('50') + Key('c-1,f5') + Pause('50') + Key('w-6'),
# editing
'Blossom': Key("cs-b"),
'blessed load': Key("cs-b") + Pause('800') + Key('w-4') + Pause('50') + Key('c-1,f5') + Pause('50') + Key('w-6'),
'Load web': Key('w-4') + Pause('50') + Key('c-1,f5') + Pause('50') + Key('w-6'),
'surround with': Key('c-e, c-u'),
'line comment': Key('c-k,c-c'),
'line uncomment': Key('c-k,c-u'),
'Replace all' : Key('a-a'),
'goat replace' : Key('c-h'),
'Clean code' : Key('c-e,c-f'),
'add class': Key('ca-insert, down:6, enter'),
'add controller': Key('ca-insert,enter'),
# git
'get called <number> <dashtext>': Key("alt,t,n,o") + Text("git cob feature/DF-%(number)s-%(dashtext)s"),
'get check out develop': Key("alt,t,n,o") + Text("git co develop") + Key("enter"),
'get check out <nospace>': Key("alt,t,n,o") + Text("git co %(nospace)s/"),
'get check out MC': Key("alt,t,n,o") + Text("git co feature/new-mcapi-integration") + Key('enter'),
'get discard': Key("alt,t,n,o") + Text("git checkout -- .") + Key("enter"),
'get merge <text>': Key("alt,t,n,o") + Text("git merge --%(text)s") + Key("enter"), #Abort, merge
'get merge develop': Key("alt,t,n,o") + Text("git merge origin/develop") + Key("enter"),
'get merge feature': Key("alt,t,n,o") + Text("git merge feature/DF-"),
'get pull': Key("alt,t,n,o") + Text("git pull") + Key("enter"),
'get push': Key("alt,t,n,o") + Text("git push") + Key("enter"),
'get stash': Key("alt,t,n,o") + Text("git stash") + Key("enter"),
'get stash <text>': Key("alt,t,n,o") + Text("git stash %(text)s") + Key("enter"), #drop/pop
'get commit <text>': Key("alt,t,n,o") + Text('git add -A && git commit -m "%(text)s"'),
# 'get add': Key("alt,t,n,o") + Text('git add -A') + Key('enter'),
# Snippets
'Open snippets': Key('c-k,c-b'),
'prop snip': Text('prop') + Key('tab'),
'See tour snip': Text('ctor') + Key('tab'),
# Opening solutions
'Open solution': Key("cs-o"),
}
extras=[
Integer('tab', 1, 10),
Integer('number', 0, 9999),
Dictation("text"),
Dictation("dashtext", default="").lower().replace(" ", "-"),
Dictation("nospace", default="").lower().replace(" ", ""),
]
context = AppContext(executable='devenv')
grammar=Grammar('Visual Studio',context=context)
grammar.add_rule(VisualStudioMappings())
grammar.load()
def unload():
global grammar
if grammar: grammar.unload()
grammar = None