-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcapslox-karabiner.edn
173 lines (160 loc) · 8.07 KB
/
capslox-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
{;; here's the definition
;; ! | means mandatory
;; # | means optional
;; C | left_command
;; T | left_control
;; O | left_option
;; S | left_shift
;; F | fn
;; Q | right_command
;; W | right_control
;; E | right_option
;; R | right_shift
;; P | caps_lock
;; !! | mandatory command + control + optional + shift (hyper)
;; ## | optional any
:profiles {:Default {:default true
:sim 50 ;; simultaneous_threshold_milliseconds (def: 50)
;; if keydown event for two different keys are pressed within :sim ms, the keypresses are considered simultaneous
:delay 50 ;; to_delayed_action_delay_milliseconds (def: 500)
;; after :delay ms, the key press is considered to be delayed (used for double-press macros)
:alone 50 ;; to_if_alone_timeout_milliseconds (def: 1000)
;; if keyup event comes within :alone ms from keydown, the key is not just pressed but held
:held 50}} ;; to_if_held_down_threshold_milliseconds (def: 500)
;; key is fired twice when :held ms is elapsed (otherwise seen as a hold command) (TODO WHAT IS THIS??)
;the default value is 250
:simlayer-threshold 500
:applications {:terminals ["^com\\.apple\\.Terminal$", "^com\\.googlecode\\.iterm2$", "^com\\.jetbrains\\.(.*)$"]
:textEditors ["^app\\.cyan\\.taio$", "^com\\.agiletortoise\\.Drafts-OSX$"]
:taio ["^app\\.cyan\\.taio$"]
:drafts ["^com\\.agiletortoise\\.Drafts-OSX$"]
:jetbrains ["^com\\.jetbrains\\.(.*)$"]
:vscode ["^com\\.microsoft\\.VSCode$"]
:ide ["^com\\.jetbrains\\.(.*)$", "^com\\.microsoft\\.VSCode$"]}
:main [{:des "Capslock赋能Hyper"
:rules [;; Capslock键设置为Hyper键
[:##caps_lock :!QWEright_shift nil {:alone :escape}]
;; Hyper + Esc = 切换大小写
[:!QWER#Pescape :caps_lock]
;; Hyper + SpaceBar = 切换输入法
[:!QWERspacebar :!Tspacebar]]}
{:des "Hyper => 光标移动"
:rules [;; Hyper + E = 向上移动
[:!QWERe :up_arrow]
;; Hyper + D = 向下移动
[:!QWERd :down_arrow]
;; Hyper + S = 向左移动
[:!QWERs :left_arrow]
;; Hyper + F = 向右移动
[:!QWERf :right_arrow]
;; Hyper + A = 向左移动一个单词
[:!QWERa :!Oleft_arrow]
;; Hyper + G = 向右移动一个单词
[:!QWERg :!Oright_arrow]
;; Hyper + P = 移动至行首
[:!QWERp :!Cleft_arrow [:!terminals]]
;; Hyper + ; = 移动至行尾
[:!QWERsemicolon :!Cright_arrow [:!terminals]]
;; Hyper + P = 移动至行首(terminal中)
[:!QWERp :!Ta [:terminals]]
;; Hyper + ; = 移动至行尾(terminal中)
[:!QWERsemicolon :!Te [:terminals]]
;; Hyper + Command + P = 移动至页首
[:!QWERCp :!FCleft_arrow [:!textEditors]]
;; Hyper + Command + ; = 移动至页尾
[:!QWERCsemicolon :!FCright_arrow [:!textEditors]]
;; Hyper + Command + P = 移动至页首(textEditor中)
[:!QWERCp :!Cup_arrow [:textEditors]]
;; Hyper + Command + ; = 移动至页尾(textEditor中)
[:!QWERCsemicolon :!Cdown_arrow [:textEditors]]]}
{:des "Hyper => 光标选中"
:rules [;; Hyper + I = 向上选中
[:!QWERi :!Sup_arrow]
;; Hyper + K = 向下选中
[:!QWERk :!Sdown_arrow]
;; Hyper + J = 向左选中
[:!QWERj :!Sleft_arrow]
;; Hyper + L = 向右选中
[:!QWERl :!Sright_arrow]
;; Hyper + H = 向左选中一个单词
[:!QWERh :!OSleft_arrow]
;; Hyper + N = 向右选中一个单词
[:!QWERn :!OSright_arrow]
;; Hyper + Y = 向外括选区域
[:!QWERy :!Oup_arrow]
;; Hyper + B = 向内缩减区域
[:!QWERb :!Odown_arrow]
;; Hyper + U = 选中至行首
[:!QWERu :!SCleft_arrow]
;; Hyper + O = 选中至行尾
[:!QWERo :!SCright_arrow]
;; Hyper + Command + U = 选中至页首
[:!QWERCu :!SFCleft_arrow [:jetbrains]]
;; Hyper + Command + O = 选中至页首
[:!QWERCo :!SFCright_arrow [:jetbrains]]
;; Hyper + Command + U = 选中至页首
[:!QWERCu :!SCup_arrow [:!jetbrains]]
;; Hyper + Command + O = 选中至页首
[:!QWERCo :!SCdown_arrow [:!jetbrains]]
;; Hyper + , = 选中当前单词
[:!QWERcomma [:!Oleft_arrow :!OSright_arrow]]
;; Hyper + Command + , = 选中当前行
[:!QWERCcomma [:!Cleft_arrow :!SCright_arrow]]
;; Hyper + Command + I = 选中的行向上移动
[:!QWERCi :!SOup_arrow [:!textEditors]]
;; Hyper + Command + I = 选中的行向上移动(taio中)
[:!QWERCi :!COup_arrow [:taio]]
;; Hyper + Command + I = 选中的行向上移动(drafts中)
[:!QWERCi :!Oup_arrow [:drafts]]
;; Hyper + Command + K = 选中的行向下移动
[:!QWERCk :!SOdown_arrow [:!textEditors]]
;; Hyper + Command + K = 选中的行向下移动(taio中)
[:!QWERCk :!COdown_arrow [:taio]]
;; Hyper + Command + K = 选中的行向下移动(drafts中)
[:!QWERCk :!Odown_arrow [:drafts]]
;; Hyper + Option + r = 重命名选中变量名/函数名(jetbrains中)
[:!QWEROr :!Sf6 [:ide]]]}
{:des "Hyper => 文本删除"
:rules [;; Hyper + W = 向左删除
[:!QWERw :delete_or_backspace]
;; Hyper + R = 向右删除
[:!QWERr :delete_forward]
;; Hyper + Command + W = 向左删除一个单词
[:!QWERCw :!Odelete_or_backspace]
;; Hyper + Command + R = 向右删除一个单词
[:!QWERCr :!Odelete_forward]
;; Hyper + [ = 删除至行首
[:!QWERopen_bracket [:!SCleft_arrow :delete_or_backspace]]
;; Hyper + / = 删除至行尾
[:!QWERslash [:!SCright_arrow :delete_or_backspace]]
;; Hyper + Delete = 删除当前行
[:!QWERdelete_or_backspace :!Cdelete_or_backspace [:!textEditors]]
;; Hyper + Delete = 删除当前行
[:!QWERdelete_or_backspace [:!Cright_arrow :!SCleft_arrow :delete_or_backspace] [:textEditors]]
;; Hyper + Command + Delete = 删除全部内容
[:!QWERCdelete_or_backspace [:!Ca :delete_or_backspace]]]}
{:des "Hyper => F1~F12"
:rules [;; Hyper + 1 = F1
[:!QWER1 :f1]
;; Hyper + 2 = F2
[:!QWER2 :f2]
;; Hyper + 3 = F3
[:!QWER3 :f3]
;; Hyper + 4 = F4
[:!QWER4 :f4]
;; Hyper + 5 = F5
[:!QWER5 :f5]
;; Hyper + 6 = F6
[:!QWER6 :f6]
;; Hyper + 7 = F7
[:!QWER7 :f7]
;; Hyper + 8 = F8
[:!QWER8 :f8]
;; Hyper + 9 = F9
[:!QWER9 :f9]
;; Hyper + 0 = F10
[:!QWER0 :f10]
;; Hyper + - = F11
[:!QWERhyphen :f11]
;; Hyper + = = F12
[:!QWERequal_sign :f12]]}]}