Skip to content

Commit fb896ad

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.
1 parent 2aa9171 commit fb896ad

File tree

4 files changed

+315
-0
lines changed

4 files changed

+315
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,18 @@ without holding the key until escaped with <kbd>Alt</kbd> or <kbd>AltGr</kbd>.
157157
<em>Fn layer toggled</em>
158158
</p>
159159

160+
##### HRM friendly variant
161+
162+
The basic `Navigation` layer’s `WASZXCV` shortcuts are useful for some layouts, but they can be seen as a waste of layer space when using Home Row Mods.
163+
164+
This variant replaces QWERTY shorcuts by the following:
165+
- cross-platform quit shortcut
166+
- HRM optimized `tab` and `S-tab`
167+
- easy to use `escape` and `delete`
168+
- three empty spots for your own keys or layers
169+
170+
![HRM friendly Vim navigation layer on a 33-key keyboard](./img/vim_hrm_navigation.svg)
171+
160172
### 5. Keyboard layout
161173

162174
Choose your keyboard layout among the available ones for Arsenik to work

img/vim_hrm_navigation.svg

Lines changed: 248 additions & 0 deletions
Loading
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 XX XX XX XX
30+
f5 f6 f7 f8 XX XX lctl lalt lmet _
31+
f9 f10 f11 f12 XX XX XX XX XX 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)