-
Notifications
You must be signed in to change notification settings - Fork 0
/
karabiner.edn
208 lines (202 loc) · 7.37 KB
/
karabiner.edn
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
;Mod-Tap Layers example
{
:devices {
:kinesis [{:vendor_id 10730}]}
:applications {
:jetbrains ["^com\\.jetbrains$"]
:slack ["com\\.tinyspeck\\.slackmacgap"]
}
:templates {
:hs-mode "open -g hammerspoon://karabiner-mode-change?mode=%s\\&active=%d"
:hs-vimac-start "open -g hammerspoon://start-recursive-vimac"
:hs-vimac-stop "open -g hammerspoon://stop-recursive-vimac"
}
:main [
{:des "layers"
:rules [;characters-layer
[:keypad_slash ["characters-layer" 1] [:!e-layer :!n-layer :!enter-layer :!delete-layer]
{:afterup ["characters-layer" 0] :alone :down_arrow}]
;delete-layer
[:equal_sign ["delete-layer" 1] [:!e-layer :!n-layer :!enter-layer :!characters-layer :kinesis]
{:afterup [["delete-layer" 0] ["navigation-layer" 0]] :alone :!Cspacebar}]
;enter-layer
[:return_or_enter [["enter-layer" 1] [:hs-mode "enter_layer" 1]] [:!e-layer :!n-layer :!delete-layer :!characters-layer]
{:afterup [["enter-layer" 0] [:hs-mode "enter_layer" 0]] :alone :return_or_enter}]
;e-layer
[:e nil [:!n-layer :!enter-layer :!delete-layer :!characters-layer :!navigation_layer]
{:alone {:key :e :halt true} :delayed {:canceled {:key :e}} :held {:set ["e-layer" 1] :repeat false} :afterup {:set ["e-layer" 0]}
:params {:alone 169 :held 170 :delay 170}}]
;n-layer
[:n nil [:!e-layer :!enter-layer :!delete-layer :!characters-layer :!navigation_layer]
{:alone {:key :n :halt true} :delayed {:canceled {:key :n}} :held {:set ["n-layer" 1] :repeat false} :afterup {:set ["n-layer" 0]}
:params {:alone 169 :held 170 :delay 170}}]
[:left_shift ["shift-layer" 1] [:!e-layer :!n-layer :!enter-layer :!delete-layer :kinesis]
{:afterup ["shift-layer" 0] :alone :escape}]
]}
{
:des "main layer modification"
:rules [:kinesis
[:##9 :comma]
;; [:3 ["navigation-layer" 1]]
[:##left_command :left_command nil {:alone {:key :tab}}]
[:spacebar :left_shift [:!e-layer] {:alone {:key :spacebar}}]
[[:s :t] :!COTt]]} ;vimac scroll
{
:des "slack"
:rules [
:slack
:enter-layer
[:e :!Ck]]}
;; {
;; :des "zoom mouse mode"
;; :rules [:zoom-mouse-mode
;; [:s :Of12]]
;; }
{
:des "vimac homerow"
:rules[
:jetbrains
[:right_arrow :!COTt]
:delete-layer
[:u :!TOSreturn_or_enter] ; show hints
[:n [:!TOSreturn_or_enter ["vimac-mode" 1] [:hs-vimac-start]]] ; hints continous
:vimac-mode
[:escape [:escape ["vimac-mode" 0] [:hs-vimac-stop]]]
]}
{
:des "jetbrains"
:rules [:jetbrains
:enter-layer
[:u [:!Cup_arrow ["navigation-layer" 0] [:hs-mode "navigation_layer" 1]]]
[:h :!Tg] ;select next cursor
[:t :!Ttab] ;control tab - last file
[:g :!Cslash] ;comment out code
[:r :!Sescape] ;hide current window
[:n :!Oreturn_or_enter] ;resolve imports
[:m :!Of8] ;evaluate expression
]}
{
:des "Comma modificator super"
:rules [:characters-layer
[:##keypad_asterisk :comma]]}
{
:des "Comma modificator"
:rules [:delete-layer
[:period :comma]]}
{
:des "app switcher"
:rules [:delete-layer
[:s :!Ctab]
[:c :!Cgrave_accent_and_tilde]
[:r :!Otab]]}
{
:des "copy/paste"
:rules [:delete-layer
[:l :!Cc]
[:g :!Cv]]}
{
:des "rectangle"
:rules [:shift-layer
[:r :!TOleft_arrow]
[:t :!TOright_arrow]
[:l :!TOup_arrow]
[:c :!TOdown_arrow]
[:a :!TOe]
[:g :!TOt]
[:s :!TOreturn_or_enter]]}
{
:des "navigation layer"
:rules [:navigation-layer
[:return_or_enter ["navigation-layer" 0]]
[:s :return_or_enter]
[:t ["navigation-layer" 0]]
[:u :up_arrow]
[:e :down_arrow]
[:n :left_arrow]
[:i :right_arrow]]}
;; {
;; :des "intellij"
;; :rules [[:u[:!Cup_arrow["navigation-layer" 1]]]
;; [:e :!TSdown_arrow]
;; [:u :!TSup_arrow]
;; [:n :!Cf12]]}
{:des "back and forward navigation"
:rules [:delete-layer
[:e :!Copen_bracket]
[:keypad_slash :!Cclose_bracket]
[:i :!Cf]
;; [:a :!C]
]}
{
:des "navigation-layer-mod"
:rules [:kinesis
:e-layer
[:n :down_arrow]
[:i :up_arrow]
[:u :!Stab]]}
{
:des "numbers"
:rules [
:e-layer
[:d :3]
[:c :2]
[:v :1]
[:t :6]
[:s :5]
[:r :4]
[:p :9]
[:l :8]
[:w :7]
[:equal_sign :0]]}
{:des "tabbing"
:rules [:delete-layer
[:t :!OCright_arrow]
[:d :!OCleft_arrow]]}
;; {
;; :des "Global app search"
;; :rules [[:!TOSspacebar :!Cspacebar]]}
;; {
;; :des "arrows"
;; :rules [[:n :left_arrow]
;; [:i :right_arrow]
;; [:u :up_arrow]
;; [:e :down_arrow]]}
{:des "special characters"
:rules [:kinesis
[:##8 :comma]
;character layer
:characters-layer
[:s :equal_sign]
[:p :!Shyphen]
[:2 :!S3]
[:3 :!S8]
[:w :hyphen]
[:l :!S4]
[:b :grave_accent_and_tilde]
[:a :!Sslash]
[:r :slash]
[:t :!Squote]
[:g :quote]
[:z :!S1]
[:v :!Ssemicolon]
[:v :!Ssemicolon]
[:c :semicolon]
[:d :!Sequal_sign]
[:x :!S5]
[:h :!S2]
[:period :!Sbackslash]
[:right_arrow :backslash]
;n-layer
:n-layer
[:t :!S9]
[:d :!S0]
[:r :!Sopen_bracket]
[:v :!Sclose_bracket]
[:s :open_bracket]
[:c :close_bracket]
[:p :!Sgrave_accent_and_tilde]
[:w :!S7]
[:e :!Scomma]
[:keypad_slash :!Speriod]
[:l :!S6]]}
]}