yep, more dotfiles
1;; This file should be in close to the configs in `github:mrnossiom/zmk-config`
2
3;; Timing variables for tap-hold effects.
4(defvar
5 ;; The key must be pressed twice in 200ms to enable repetitions.
6 tap_timeout 150
7 ;; The key must be held 200ms to become a layer shift.
8 hold_timeout 150
9 ;; Slightly higher value for typing keys, to prevent unexpected hold effect.
10 long_hold_timeout 150
11)
12
13;; angle-mod: the ISO key (a.k.a. LSGT or 102 key) becomes Z
14(defsrc
15 1 2 3 4 5 bspc 6 7 8 9 0
16 q w e r t y u i o p
17 a s d f g h j k l ;
18 < z x c v b n m , . /
19 lmet lalt spc ralt rctl
20)
21
22;; Base layer: layer-taps under the thumbs + home-row mods on SDF and JKL
23(deflayer base
24 _ _ _ _ _ _ _ _ _ _ _
25 q w e r t y u i o p
26 @aa @ss @dd @ff g h @jj @kk @ll @semisft
27 z x c v b < n m , . /
28 _ @num @nav @sym _
29)
30
31;; Timing variables are defined in `kanata.kbd` file.
32(defalias
33 nav (tap-hold $tap_timeout $long_hold_timeout spc (layer-while-held navigation))
34 num (tap-hold-press $tap_timeout $hold_timeout bspc (layer-while-held numrow))
35 sym (tap-hold-press $tap_timeout $hold_timeout ret (layer-while-held symbols))
36
37 semi ;
38
39 ;; Home-row mods
40 aa (tap-hold $tap_timeout $long_hold_timeout a lsft)
41 ss (tap-hold $tap_timeout $long_hold_timeout s lalt)
42 dd (tap-hold $tap_timeout $long_hold_timeout d lmet)
43 ff (tap-hold $tap_timeout $long_hold_timeout f lctl)
44 jj (tap-hold $tap_timeout $long_hold_timeout j rctl)
45 kk (tap-hold $tap_timeout $long_hold_timeout k rmet)
46 ll (tap-hold $tap_timeout $long_hold_timeout l ralt)
47 semisft (tap-hold $tap_timeout $long_hold_timeout @semi rsft)
48)
49
50;; Symbol layer: same as AltGr but enables a NumRow.
51(deflayer symbols
52 AG-1 AG-2 AG-3 AG-4 AG-5 XX AG-6 AG-7 AG-8 AG-9 AG-0
53 @^ @< @> @$ @% @@ @& @* @' @`
54 @{ @pl @pr @} @= @\ @+ @- @/ @''
55 @~ @[ @] @_ @# XX @| @! @; @: @?
56 XX XX spc XX XX
57)
58
59;; Numrow layer
60(deflayer numrow
61 XX XX XX XX XX XX XX XX XX XX XX
62 XX XX XX XX XX XX XX XX XX XX
63 @1 @2 @3 @4 @5 @6 @7 @8 @9 @0
64 XX XX XX XX XX XX XX XX XX XX XX
65 XX XX XX XX XX
66)
67
68;; Vim-Navigation layer:
69;; - right: Vim-like arrows on HJKL, home/end page up/down, mouse scroll
70;; - left: one-hand shortcuts (Cmd/Ctrl-WASZXCV), Tab/Shift-Tab, prev/next
71;; - top: Super-num (i3/sway) or Alt-num (browser), zoom in/out
72(deflayer navigation
73 M-1 M-2 M-3 M-4 M-5 XX M-6 M-7 M-8 M-9 M-0
74 @pad @cls bck fwd XX home pgdn pgup end @run
75 @all @sav S-tab tab XX lft down up rght @fun
76 @ndo @cut @cpy @pst XX XX @mwl @mwd @mwu @mwr XX
77 XX del XX esc XX
78)
79
80;; NumPad
81(deflayer numpad
82 XX XX XX XX XX XX XX XX XX XX XX
83 XX home up end pgup @/ @7 @8 @9 XX
84 XX lft down rght pgdn @- @4 @5 @6 @0
85 XX XX XX XX XX XX @, @1 @2 @3 @.
86 XX @std XX @std ∅
87)
88
89;; function keys
90(deflayer funpad
91 XX XX XX XX XX XX XX XX XX XX XX
92 f1 f2 f3 f4 @volup @brghtup XX XX XX XX
93 f5 f6 f7 f8 @voldn @brghtdn lctl lalt lmet XX
94 f9 f10 f11 f12 XX XX XX XX XX XX XX
95 XX @std XX @std XX
96)
97
98(defalias
99 std (layer-switch base)
100 pad (layer-switch numpad)
101 fun (layer-switch funpad)
102
103 ;; TODO: find how to implement these with XF86 keys
104 volup XX
105 voldn XX
106 brghtup XX
107 brghtdn XX
108
109 ;; Mouse wheel emulation
110 mwu (mwheel-up 50 120)
111 mwd (mwheel-down 50 120)
112 mwl (mwheel-left 50 120)
113 mwr (mwheel-right 50 120)
114)
115
116;; Key of the application launcher, mapped to P(nav)
117(defalias run M-d)
118
119;; Qwerty/Colemak Windows/Linux aliases
120;; Works with QWERTY-US, Colemak and others.
121
122;; Navigation layer
123(defalias
124 all C-a
125 sav C-s
126 cls C-w
127 ndo C-z
128 cut C-x
129 cpy C-c
130 pst C-v
131
132 0 0
133 1 1
134 2 2
135 3 3
136 4 4
137 5 5
138 6 6
139 7 7
140 8 8
141 9 9
142 , ,
143 . .
144)
145
146;; Symbols layer
147(defalias
148 ^ S-6
149 < S-,
150 > S-.
151 $ S-4
152 % S-5
153 @ S-2
154 & S-7
155 * S-8
156 ' '
157 ` `
158
159 { S-[
160 pl S-9
161 pr S-0
162 } S-]
163 = =
164 \ \
165 + S-=
166 - -
167 / /
168 '' S-'
169
170 ~ S-`
171 [ [
172 ] ]
173 _ S--
174 # S-3
175 | S-\
176 ! S-1
177 ; ;
178 : S-;
179 ? S-/
180)