Skip to content

Commit 39b7ebd

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] - @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] @pad → [A] - @pad thus mirrors @fun on the right hand - allows using the numpad’s arrow keys without locking the layer (layer-while-held) ## 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 2aa9171 commit 39b7ebd

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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 esc bck fwd XX home pgdn pgup end @run
12+
@pad 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+
;; Choose the quit shortcut according to your OS.
42+
;; qut C-q ;; [Control]-[Q] (Linux)
43+
;; qut M-q ;; [Command]-[Q] (macOS)
44+
;; qut A-f4 ;; [Alt]-[F4] (Windows)
45+
qut XX ;; do nothing
46+
47+
;; Mouse wheel emulation
48+
mwu (mwheel-up 50 120)
49+
mwd (mwheel-down 50 120)
50+
mwl (mwheel-left 50 120)
51+
mwr (mwheel-right 50 120)
52+
)
53+
54+
;; 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)