Skip to content

Commit 6837f15

Browse files
committed
feat(kanata): add HRM-optimized navigation layer
## HRM friendly S-tab/tab S-tab and tab stay on the homerow while playing nice with Ctrl and Alt mods. ## Add cross-platform quit shortcut on HRM nav layer - @qut → [Q] - @pad → [W] Rationale: - @qut allows closing apps on any OS (C-q on Linux, A-f4 on Windows, etc.), optimizing muscular memory - it is more coherent to map @qut on [Q] ## Map esc/del on [A]/[V] The goal is to allow escaping and deleting using the left hand only. ## Media controls in funpad Because funpad stands for fun! Rationale: mod keys in the existing funpad are pointless with HRMs.
1 parent d433298 commit 6837f15

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
;; Vim-Navigation layer (optimized for home-row mods):
2+
;; - right: Vim-like arrows on HJKL, home/end page up/down, mouse scroll
3+
;; - left: Tab/Shift-Tab, prev/next, quit, esc, del
4+
;; - top: Super-num (i3/sway) or Alt-num (browser), zoom in/out
5+
6+
;; The `lrld` action stands for "live reload". This will re-parse everything
7+
;; except for linux-dev, i.e. you cannot live reload and switch keyboard devices.
8+
9+
(deflayer navigation
10+
M-1 M-2 M-3 M-4 M-5 lrld M-6 M-7 M-8 M-9 M-0
11+
@qut @pad bck fwd XX home pgdn pgup end @run
12+
esc S-tab tab tab XX lft down up rght @fun
13+
XX XX XX del XX _ @mwl @mwd @mwu @mwr XX
14+
del _ esc
15+
)
16+
17+
;; NumPad
18+
(deflayer numpad
19+
_ _ _ _ _ _ _ _ _ _ _
20+
XX home up end pgup @/ @7 @8 @9 XX
21+
XX lft down rght pgdn @- @4 @5 @6 @0
22+
XX XX XX XX XX _ @, @1 @2 @3 @.
23+
@std @nbs @std
24+
)
25+
26+
;; function keys
27+
(deflayer funpad
28+
XX XX XX XX XX XX XX XX XX XX XX
29+
f1 f2 f3 f4 XX XX prev pp next XX
30+
f5 f6 f7 f8 XX XX vold volu mute _
31+
f9 f10 f11 f12 XX XX XX brdn bru XX XX
32+
_ _ _
33+
)
34+
35+
(defalias
36+
std (layer-switch base)
37+
pad (layer-switch numpad)
38+
39+
fun (layer-while-held funpad)
40+
41+
;; Replace XX by the keyboard shortcut to quit applications on your OS.
42+
;; qut C-q ;; [Command]-[Q]
43+
qut XX ;; do nothing
44+
45+
;; Mouse wheel emulation
46+
mwu (mwheel-up 50 120)
47+
mwd (mwheel-down 50 120)
48+
mwl (mwheel-left 50 120)
49+
mwr (mwheel-right 50 120)
50+
)
51+
52+
;; vim: set ft=lisp

kanata/kanata.kbd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959

6060
(include deflayer/navigation.kbd) ;; ESDF on the left, NumPad on the right
6161
;; (include deflayer/navigation_vim.kbd) ;; HJKL + NumPad on [Space]+[Q]
62+
;; (include deflayer/navigation_vim_hrm.kbd) ;; HJKL + NumPad on [Space]+[W], optimized for home-row mods
6263

6364
;; Replace XX by the keyboard shortcut of your application launcher, if any.
6465
;; Mapped on [Space]+[P] in both navigation layers.

0 commit comments

Comments
 (0)