-
Notifications
You must be signed in to change notification settings - Fork 19
/
karabiner.edn
355 lines (355 loc) · 18.9 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
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
{:templates {:launch "osascript -e 'tell application \"Alfred 3\" to run trigger \"launch%s\" in workflow \"yqrashawn.workflow.launcher\" with argument \"\"'"
:alf "osascript -e 'tell application \"Alfred 3\" to run trigger \"%s\" in workflow \"%s\" with argument \"\"'"
:km "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"%s\"'"
:2do "open 'twodo://x-callback-url/%s'"
:kb-maestro "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"%s\"'"}
:layers {:tab-mode {:key :tab :afterup [{:set ["chunkwm-move-mode" 0]}
{:set ["chunkwm-scale-mode" 0]}]}
:chunkwm-move-mode {:key :f :condi :tab-mode}
:chunkwm-scale-mode {:key :c :condi :tab-mode}}
:simlayers {:contexts-f-mode {:key :f}
:2do-mode {:key :t}
:2do-s-mode {:key :s :condi :2do}
:emacs-s-mode {:key :s :condi :Emacs}
:vi-mode {:key :d}
:vi-visual-mode {:key :v :condi :!vim-mode-disabled-application}
:launch-mode {:key :w}
:emacs-winmove-mode {:key :q :condi :Emacs}
:tmux-winmove-mode {:key :q :condi :Terminals}
:q-mode {:key :q}
:period-mode {:key :period :afterup {:set ["period-comma-mode" 0]}}
:comma-mode {:key :comma}
:alfred-mode {:key :z}
:finder-alfred-mode {:key :z :condi :Finder}
:browsers-alfred-mode {:key :z :condi :Browsers}
:e-mode {:key :e}}
:main [{:des "disable command-tab"
:rules [[:!Ctab :vk_none]]}
{:des "contexts"
:rules [[:escape [:escape ["in-contexts" 0]] ["in-contexts" 1]]
[{:pkey :button1} [{:pkey :button1} ["in-contexts" 0]] ["in-contexts" 1]]
[:left_control [:left_control] ["in-contexts" 1] {:alone [:escape ["in-contexts" 0]]}]
[:##caps_lock [:left_control] ["in-contexts" 1] {:alone [:escape ["in-contexts" 0]]}]
[:return_or_enter [:return_or_enter ["in-contexts" 0]] ["in-contexts" 1]]
[:!Tm [:return_or_enter ["in-contexts" 0]] ["in-contexts" 1]]
:contexts-f-mode
[:j [["in-contexts" 1] :f16] ["in-contexts" 0]]
[:k [["in-contexts" 1] :f16] ["in-contexts" 0]]
[:j :down_arrow ["in-contexts" 1]]
[:k :up_arrow ["in-contexts" 1]]
[:l [:return_or_enter ["in-contexts" 0]] ["in-contexts" 1]]]}
#_{:des "in-alfred"
:rules [[:!Tw :!Odelete_or_backspace ["in-alfred" 1]]
[:escape [:escape ["in-alfred" 0]] ["in-alfred" 1]]
[:left_control :left_control ["in-alfred" 1] {:alone [:escape ["in-alfred" 0]]}]
[:!Ctab [:!Ctab ["in-alfred" 0]] ["in-alfred" 1]]
[:!Cright_command [:!Ctab ["in-alfred" 0]] ["in-alfred" 1]]
[:!Tsemicolon [:!Treturn_or_enter ["in-alfred" 0]] ["in-alfred" 1]]
[:!Tl [:return_or_enter ["in-alfred" 0]] ["in-alfred" 1]]
[:!Tj :down_arrow ["in-alfred" 1]]
[:!Tk :up_arrow ["in-alfred" 1]]
[:!Oh :left_arrow ["in-alfred" 1]]
[:!Oj :down_arrow ["in-alfred" 1]]
[:!Ok :up_arrow ["in-alfred" 1]]
[:!Ol :right_arrow ["in-alfred" 1]]
[:!OSh :!OSleft_arrow ["in-alfred" 1]]
[:!OSj :!OSdown_arrow ["in-alfred" 1]]
[:!OSk :!OSup_arrow ["in-alfred" 1]]
[:!OSl :!OSright_arrow ["in-alfred" 1]]]}
{:des "2do"
:rules [:2do-mode
[:l [:km "2Do: Capture URL to Read"] :Browsers]
[:spacebar [:2do "showToday"]]
:2do-s-mode
[:j [:!Cdown_arrow]]
[:k [:!Cup_arrow]]
[:l [:j]]
[:f [:!Cf]]
[:d [:!C5]]
[:i [:!C0]]
[:t [:!C2]]
[:a [:!C1]]
[:v [:!C4]]]}
{:des "s-mode in emacs, awesome-tab"
:rules [:emacs-s-mode
;; [:h [:!Tx :!T9 {:key :h :repeat false}]]
;; [:j [:!Tx :!T9 {:key :j :repeat false}]]
;; [:k [:!Tx :!T9 {:key :k :repeat false}]]
;; [:l [:!Tx :!T9 {:key :l :repeat false}]]
;; [:n [:!Tx :!T9 {:key :n :repeat false}]]
;; [:p [:!Tx :!T9 {:key :p :repeat false}]]
[:h :!!h]
[:j :!!j]
[:k :!!k]
[:l :!!l]
[:n :!!n]
[:p :!!p]
[:delete_or_backspace [:!Tx :!T9 :!Sk]]
[:open_bracket [:!Tx :!T9 :open_bracket]]
[:close_bracket [:!Tx :!T9 :close_bracket]]]}
{:des "Vi Mode [D as Trigger Key]"
:rules [:vi-mode
[:##j :down_arrow]
[:##k :up_arrow]
[:##h :left_arrow]
[:##l :right_arrow]
[:##b :!Oleft_arrow]
[:##w :!Oright_arrow]
[:##0 :!Ta]
[:##4 :!Te]]}
{:des "Vi Visual Mode"
:rules [:vi-visual-mode
[:##j :!Sdown_arrow]
[:##k :!Sup_arrow]
[:##h :!Sleft_arrow]
[:##l :!Sright_arrow]
[:##b :!SOleft_arrow]
[:##w :!SOright_arrow]
[:##0 :!SCleft_arrow]
[:##4 :!SCright_arrow]
[:##open_bracket :!SOup_arrow]
[:##close_bracket :!SOdown_arrow]]}
{:des "Emacs switch buffer"
:rules [:Emacs
[:tab :!Ttab :period-mode]
[:tab :!TStab :comma-mode]]}
{:des "launcher mode"
:rules [:launch-mode
[:j [:launch "Alacritty"]]
[:k [:launch "Emacs"]]
[:l [:launch "Safari"]]
[:m [:launch "Mail"]]
[:v [:launch "WeChat"]]
[:q [:launch "KE"]]
[:f [:launch "Finder"]]
[:9 [:launch "PDFExpert"]]
[:comma [:launch "Safari"]]
[:h [:launch "Chrome"]]
[:period [:launch "Paw"]]
[:equal_sign [:launch "Textual"]]
[:8 [:launch "KEEvents"]]
[:b [:launch "BearyChat"]]
[:c [:launch "VSCode"]]
[:t [:launch "2do"]]
[:r [:launch "Timing"]]]}
{:des "caps_lock"
:rules [[:##caps_lock :left_control nil {:alone :escape}]]}
{:des "HHKB, FILCO MINILA Change left control to esc if alone"
:rules [[:##left_control :left_control [:hhkb-bt :hhkb :hhkb-tmk :filco-minila] {:alone :escape}]]}
{:des "Left Right Shift Press Alone"
:rules [[:right_shift :right_shift nil {:alone :!TSz}]]}
{:des "Change right_command to command-tab when used alone"
:rules [[:right_command :right_command nil {:alone [:!Ctab]}]]}
{:des "Change left_option to f18 when used alone"
:rules [[:left_option :left_option nil {:alone [:f18]}]]}
{:des "Quit application by pressing command-q twice" :rules [[:!C#Pq [:!Cq ["command-q" 0]] ["command-q" 1]]
[:!C#Pq ["command-q" 1] nil {:delayed {:invoked ["command-q" 0] :canceled ["commandq" 0]}}]]}
{:des "Change right_option to switch to second recent application when used alone"
:rules [[:right_option :right_option nil {:alone ["osascript ~/Dropbox/sync/Automator/switch-to-second-previous-app.scpt"]}]]}
{:des "some simultaneous keys"
:rules [[[:h :l] [:alf "helpSearch" "com.tedwise.menubarsearch"]]
[[:j :l] [:f19 ["in-alfred" 1]]]]}
{:des "alfred mode"
:rules [[:l :!COi :browsers-alfred-mode]
[:l :!CTslash [:finder-alfred-mode ["in-alfred" 1]]]
:alfred-mode
[:h [[:alf "search repos" "me.lachlan.githubjump"] ["in-alfred" 1]]]
[:j [:alf "searchGithub" "nikivi.search-the-web"]]
[:return_or_enter [:alf "web searches" "nikivi.web.searches"]]
[:x [:alf "killProcess" "com.ngreenstein.alfred-process-killer"]]
[:t [:alf "repos" "net.deanishe.alfred-git-repos"]]
[:k [[:alf "history" "net.deanishe.alfred.safari"] ["in-alfred" 1]]]
[:m [:alf "tab" "net.deanishe.alfred.safari"]]
[:y [:!!grave_accent_and_tilde ["in-alfred" 1]]]
[:o :!CTOS0]
[:0 [:alf "pasteBack" "yqrashawn.com.ewe"]]
[:semicolon [:alf "localport" "in.fech.localport"]]
[:q "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"Quick Macro 1\"'"]
[:close_bracket :!CTOSclose_bracket]
[:hyphen :!!hyphen]
[:right_command :!!p]]}
{:des "q"
:rules [:emacs-winmove-mode
[:h [:!Tx :7 :w :h]]
[:j [:!Tx :7 :w :j]]
[:k [:!Tx :7 :w :k]]
[:l [:!Tx :7 :w :l]]
[:v [:!Tx :3]]
[:s [:!Tx :2]]
[:m [:!Tx :1]]
[:b [:!Tx :0]]
:tmux-winmove-mode
[:comma [:!Tq :comma]]
[:open_bracket [:!Tq :open_bracket]]
[:y [:!Tq :y]]
[:f [:!Tq :f]]
[:e [:!Tq :e]]
[:w [:!Tq :w]]
[:h [:!Tq :h]]
[:j [:!Tq :j]]
[:k [:!Tq :k]]
[:l [:!Tq :l]]
[:v [:!Tq :v]]
[:s [:!Tq :s]]
[:m [:!Tq :z]]
[:b [:!Tq :x]]
[:c [:!Tq :c]]
[:1 [:!Tq :1]]
[:2 [:!Tq :2]]
[:3 [:!Tq :3]]
[:4 [:!Tq :4]]
[:5 [:!Tq :5]]]}
{:des "chunkwm mode"
:rules [:chunkwm-move-mode
[:h "/usr/local/bin/chunkc tiling::window --warp west"]
[:j "/usr/local/bin/chunkc tiling::window --warp south"]
[:k "/usr/local/bin/chunkc tiling::window --warp north"]
[:l "/usr/local/bin/chunkc tiling::window --warp east"]
:chunkwm-scale-mode
[:h "/usr/local/bin/chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge west"]
[:j "/usr/local/bin/chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge south"]
[:k "/usr/local/bin/chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge north"]
[:l "/usr/local/bin/chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge east"]
:tab-mode
[:h "/usr/local/bin/chunkc tiling::window --focus west"]
[:j "/usr/local/bin/chunkc tiling::window --focus south"]
[:k "/usr/local/bin/chunkc tiling::window --focus north"]
[:l "/usr/local/bin/chunkc tiling::window --focus east"]
[:n "/usr/local/bin/chunkc tiling::window --focus next"]
[:p "/usr/local/bin/chunkc tiling::window --focus prev"]
[:r "/usr/local/bin/chunkc tiling::desktop --rotate 90"]
[:spacebar "/usr/local/bin/chunkc tiling::window --toggle fullscreen"]
[:a "/usr/local/bin/chunkc tiling::window --toggle float"]
[:b "/usr/local/bin/chunkc tiling::desktop --layout bsp"]
[:m "/usr/local/bin/chunkc tiling::desktop --layout monocle"]
[:x "/usr/local/bin/chunkc tiling::window --close"]
[:open_bracket "/usr/local/bin/chunkc tiling::window --send-to-monitor prev"]
[:close_bracket "/usr/local/bin/chunkc tiling::window --send-to-monitor next"]]}
{:des "comma mode"
:rules [:comma-mode
[:a :open_bracket]
[:s :close_bracket]
[:d :!S7]
[:f :!S8]
[:q :!Shyphen]
[:w :!Sequal_sign]
[:e :!S5]
[:r :!S6]]}
{:des "period mode"
:rules [:period-mode
[:comma ["period-comma-mode" 1] nil {:alone :comma :afterup ["period-comma-mode" 0]}]
[:a [:!Sgrave_accent_and_tilde :slash]]
[:s [:period :!S8]]
[:d :!S9]
[:f :!S0]
[:q :hyphen]
[:w :equal_sign]
[:e :!Sopen_bracket]
[:r :!Sclose_bracket]]}
{:des "chrome debug mode"
:rules [[:condi :Chromes :tab-mode]
[:q :!Csemicolon]
[:w :!CSsemicolon]
[:e :!Cquote]
[:r :!Cf8]
[:1 :!Cbackslash]
[:2 "~/local/bin/cliclick kd:ctrl c:+0,+0 ku:ctrl t:continue kp:return"]
[:3 :f9]]}
{:des "Mouse button"
:rules [[{:pkey :button5} :mission_control]
[{:pkey :button4} [{:pkey :button1} {:pkey :button1} :!!grave_accent_and_tilde]]]}
{:des "Emacs key bindings [control+keys] (rev 10)"
:rules [[:!T#Sy :!Cv :!Emacs]
:!emacs-mode-disable-app
[:!T#Od :delete_forward]
[:!T#Oh :delete_or_backspace]
[:!T#SOw :!Odelete_or_backspace]
[:!T#Oi :tab]
[:!T#Oopen_bracket :escape]
[:!T#OSm :return_or_enter]
[:!T#OSb :left_arrow]
[:!T#OSf :right_arrow]
[:!T#OSb :left_arrow]
[:!T#OSn :down_arrow]
[:!T#OSp :up_arrow]
[:!T#Sv :page_down]
[:!T#Sa :!Cleft_arrow]
[:!T#Se :!Cright_arrow]]}
#_{:des "Anti-RSI App Switch (LCMD+Space to LCMD+Tab and reverse +LControl)."
:rules [[:!Cspacebar :!Ctab]
[:!CTspacebar :!CStab]]}]
:devices {:macbook-internal [{:product_id 631 :vendor_id 1452}]
:filco-minila [{:product_id 34050 :vendor_id 2652}]
:hhkb-tmk [{:vendor_id 65261 :product_id 51966}]
:hhkb-bt [{:vendor_id 1278 :product_id 514}]
:hhkb [{:vendor_id 2131 :product_id 256}]}
:applications {:emacs-mode-disable-app [ "^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^net\\.sf\\.cord$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.itap-mobile\\.qmote$",
"^com\\.nulana\\.remotixmac$",
"^com\\.p5sys\\.jump\\.mac\\.viewer$",
"^com\\.p5sys\\.jump\\.mac\\.viewer\\.web$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$",
"^com\\.2X\\.Client\\.Mac$",
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyperterm$",
"^co\\.zeit\\.hyper$",
"^io\\.alacritty$",
"^net\\.kovidgoyal\\.kitty$",
"^org\\.vim\\.",
"^com\\.qvacua\\.VimR$",
"^com\\.vmware\\.fusion$",
"^com\\.vmware\\.horizon$",
"^com\\.vmware\\.view$",
"^com\\.parallels\\.desktop$",
"^com\\.parallels\\.vm$",
"^com\\.parallels\\.desktop\\.console$",
"^org\\.virtualbox\\.app\\.VirtualBoxVM$",
"^com\\.vmware\\.proxyApp\\.",
"^com\\.parallels\\.winapp\\.",
"^org\\.x\\.X11$",
"^com\\.apple\\.x11$",
"^org\\.macosforge\\.xquartz\\.X11$",
"^org\\.macports\\.X11$",
"^com\\.sublimetext\\.",
"^com\\.microsoft\\.VSCode$"]
:Emacs ["^org\\.gnu\\.Emacs$"
"^org\\.gnu\\.AquamacsEmacs$"
"^org\\.gnu\\.Aquamacs$"]
:Chromes ["^com\\.google\\.Chrome$", "^org\\.chromium\\.Chromium$", "^com\\.google\\.Chrome\\.canary$"]
:Terminals ["^com\\.apple\\.Terminal$"
"^com\\.googlecode\\.iterm2$"
"^co\\.zeit\\.hyperterm$"
"^co\\.zeit\\.hyper$"
"^io\\.alacritty$"
"^net\\.kovidgoyal\\.kitty$"]
:vim-mode-disabled-application ["^com\\.apple\\.Terminal$"
"^com\\.googlecode\\.iterm2$"
"^co\\.zeit\\.hyperterm$"
"^co\\.zeit\\.hyper$"
"^io\\.alacritty$"
"^net\\.kovidgoyal\\.kitty$"
"^org\\.vim\\."
"^com\\.qvacua\\.VimR$"]
:Finder ["^com\\.apple\\.finder$"]
:Browsers ["^org\\.mozilla\\.firefox$"
"^com\\.google\\.Chrome$"
"^com\\.google\\.Chrome\\.canary$"
"^com\\.apple\\.Safari$"]
:2do ["^com\\.guidedways\\.TodoMac.*"]}
:input-sources {:squirrel {:input_mode_id "com.googlecode.rimeime.inputmethod.Squirrel"
:input_source_id "com.googlecode.rimeime.inputmethod.Squirrel.Rime"
:language "zh-Hans"}
:us {:input_mode_id ""
:input_source_id "com.apple.keylayout.US"
:language "en"}}}