-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkanata.kbd
86 lines (71 loc) · 3.38 KB
/
kanata.kbd
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
;; Quick notes about the kanata configuration syntax:
;; - the syntax is Lisp-like but totally unrelated to Lisp, so no worries :-)
;; - comments are prefixed by double-semicolons
;; - only one `defsrc` is allowed, listing all keys handled by kanata
;; - up to 25 `deflayer` are allowed, one per layer emulation
;; - the underscore symbol `_` in `deflayer` sections means "transparent",
;; i.e. the previous layer behaviour is used when pressing that key
;; `defsrc` defines the keys that will be intercepted by kanata.
;; The order of the keys matches with deflayer declarations and all deflayer
;; declarations must have the same number of keys as defsrc. Any keys not listed
;; in defsrc will be passed straight to the operating system.
(deflocalkeys-linux
< 105
)
(defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft < z x c v b n m , . / rsft
lctl lmet lalt spc ralt rmet rctl
)
;; Base layer (active by default when kanata starts up):
;; - the 3 main thumb keys become mod/taps
;; - home-row mods on SDF and JKL
;; - CapsLock becomes Escape
(deflayer qwerty
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
caps _ _ _ _ _ _ _ _ _ _ _ _
@sfl _ @ctr @alt _ _ _ _ _ _ _ _ @sfr
_ _ @tbl @nav @tbr _ _
)
;; Navigation layer:
;; - right: Vim-like arrows on HJKL, home/end page up/down, mouse scroll
;; - left: one-hand shortcuts (Ctrl-WASZXCV), Tab/Shift-Tab, prev/next
;; - up: Super-num (i3/sway) or Alt-num (browser), zoom in/out
;; The `lrld` action stands for "live reload". This will re-parse everything
;; except for linux-dev, i.e. you cannot live reload and switch keyboard devices.
(deflayer vimnav
_ M-1 M-2 M-3 M-4 M-5 M-6 M-7 M-8 M-9 M-0 C-- C-= lrld
_ _ 4 5 6 _ home pgdn pgup end _ _ _ _
caps C-a 1 2 3 0 lft down up rght _ _ _
_ _ _ 7 8 9 C-v @mwl @mwd @mwu @mwr _ _
_ _ esc _ ret _ _
)
;; `defalias` is used to declare a shortcut for a more complicated action to keep
;; the deflayer declarations clean and aligned. The alignment in deflayers is
;; not necessary, but is highly recommended for ease of understanding visually.
;; Aliases are referred to by `@<alias_name>`.
(defalias
;; layer-switch changes the base layer.
std (layer-switch qwerty)
nav (tap-hold 200 200 spc (layer-toggle vimnav))
;; Thumb keys :
tbl (tap-hold-press 200 200 bspc lsft)
tbr (tap-hold-press 200 200 del ralt)
;; previous config with dead shift (tap-hold-press 200 200 (one-shot-press 2000 rsft) ralt)
;; Tap-mods definition
;; Must be hold long enough (200ms) to become a modifier.
ctr (tap-hold 200 200 z lctl)
alt (tap-hold 200 200 x lalt)
sfl (tap-hold 200 200 del lsft)
sfr (tap-hold 200 200 ret rsft)
cw (caps-word 2000)
;; Mouse wheel emulation
mwu (mwheel-up 50 120)
mwd (mwheel-down 50 120)
mwl (mwheel-left 50 120)
mwr (mwheel-right 50 120)
)
;; vim: set ft=lisp