kanata-win/conf.kbd

183 lines
5.8 KiB
Text
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#|
Kanata Config
○ Ergonomic (kinda?) 34-key QWERTY layout
○ GACS home-row mods
○ Layers for function, number, media, and symbol keys
○ Dedicated (and non-intrusive!) standard layout toggle for reliant tasks
○ Decently commented for beginners and seasoned veterans alike.
FEEL FREE TO FORK!!!
|#
(defcfg
process-unmapped-keys yes
block-unmapped-keys yes
concurrent-tap-hold yes
movemouse-smooth-diagonals yes
)
#|
Trying to be minimal in order to reduce constant editing
of layer keys, not to mention how ugly having a 60% layout
is when you have mapped keys in the grid.
|#
(defsrc
caps
q w e r t y u i o p
a s d f g h j k l scln
z x c v b n m , . /
lalt spc ralt
)
;; Variables for clean code
(defvar
tap-time 150
hold-time 180
chord-time 50
)
;; Bindings
(defalias
;; Normal keyboard layer for gaming/other normie usage
normie (layer-switch norm)
;; Key chord definitions
chw (chord ch w)
che (chord ch e)
chi (chord ch i)
cho (chord ch o)
chs (chord ch s)
chd (chord ch d)
chf (chord ch f)
chj (chord ch j)
chk (chord ch k)
chl (chord ch l)
ch_lalt (chord ch lalt)
ch_ralt (chord ch ralt)
;; Hyper & Meh key definition for easier reading.
hyper (multi lmet lsft lctl lalt)
meh (multi lsft lctl lalt)
navlayer (layer-while-held nav)
vimnav (layer-while-held vim)
;; Remap Caps to Ctrl+Space (Raycast activation)/Nav layer on hold, with double tap for Caps Lock toggle
caps (tap-hold $tap-time $hold-time (tap-dance 200 ((multi lctl spc) caps)) @navlayer)
;; Home row mods
a (tap-hold $tap-time $hold-time a lmet)
s (tap-hold $tap-time $hold-time s lalt)
d (tap-hold $tap-time $hold-time d lctl)
f (tap-hold $tap-time $hold-time f lsft)
j (tap-hold $tap-time $hold-time j rsft)
k (tap-hold $tap-time $hold-time k lctl)
l (tap-hold $tap-time $hold-time l lalt)
scln (tap-hold $tap-time $hold-time scln rmet)
;; Numpad layer
numpad (layer-while-held num)
g (tap-hold $tap-time $hold-time g @numpad)
;; Function key layer
fnkeys (layer-while-held fn)
h (tap-hold $tap-time $hold-time h @fnkeys)
#|
MEH key when V or M are held down to allow for either hand to
use for shortcuts.
|#
v (tap-hold $tap-time $hold-time v @meh)
m (tap-hold $tap-time $hold-time m @meh)
;; Holding Spacebar activates symbol layer
symbols (layer-while-held symbol)
spc (tap-hold $tap-time $hold-time spc @symbols)
;; Media layer when Z or / are held.
medialy (layer-while-held md)
z (tap-hold $tap-time $hold-time z @medialy)
/ (tap-hold $tap-time $hold-time / @medialy)
)
;; Chord definitions. Kind of weird to read as a layperson
;; so I provided sufficient comments for general understanding.
(defchords ch $chord-time
(w ) w ;; W => W
( e) e ;; E => E
(w e) @hyper ;; W + E => Hyper
(i ) i ;; I => I
( o) o ;; O => O
(i o) @hyper ;; I + O => Hyper
(s ) @s ;; S => S
( d) @d ;; D => D
(s d) enter ;; S + D => Enter
(f ) @f ;; F => F
(f d) tab ;; F + D => Tab
(j k) esc ;; J + K => Escape
(j ) @j ;; J => J
(k ) @k ;; K => K
( l) @l ;; L => L
(k l) bspc ;; K + L => Backspace
(lalt ) (tap-dance $tap-time (@vimnav lalt)) ;; LAlt => vimnav, LAlt × 2 => LAlt
( ralt) (tap-dance $tap-time (@navlayer ralt)) ;; LAlt => nav, LAlt × 2 => LAlt
#|
Put simply, the below line allows for toggling a no-bind
layer for when you may require a standard layout (such as
playing Street Fighter, Counter Strike, etc.) by pressing
both Alt/Option keys at the same time. You can toggle back to the
base layer by holding both Alt/Option keys at the same time, as to
allow for normal functionality when holding either key down for a shortcut.
|#
(lalt ralt) (tap-hold $tap-time $hold-time @normie (layer-switch base))
)
;; Base layer with all binds enabled
(deflayer base
@caps
q @chw @che r t y u @chi @cho p
@a @chs @chd @chf @g @h @chj @chk @chl @scln
@z x c @v b n @m , . @/
@ch_lalt @spc @ch_ralt
)
;; Mouse Navigation layer
(deflayer nav
_
_ mbck (movemouse-up 3 2) mfwd _ _ _ _ _ _
(multi lctl lsft tab) (movemouse-left 3 2) (movemouse-down 3 2) (movemouse-right 3 2) (multi lctl tab) (multi lctl lsft tab) mlft mmid mrgt (multi lctl tab)
_ _ _ _ _ (mwheel-left 100 120) (mwheel-down 100 120) (mwheel-up 100 120) (mwheel-right 100 120) _
_ _ _
)
;; Arrow Navigation Layer (Vim-like bindings)
(deflayer vim
_
_ _ _ _ _ _ (multi lsft lctl left) (multi lctl left) (multi lctl right) (multi lsft lctl right)
_ _ _ _ home left down up right end _
_ _ _ _ _ _ _ _ _
_ _ _
)
;; Numpad Layer
(deflayer num
_
_ _ _ _ _ _ 7 8 9 _
_ _ _ _ _ _ 4 5 6 0 _
_ _ _ _ _ 1 2 3 _
_ _ _
)
;; Function key layer
(deflayer fn
_
f1 f2 f3 f4 _ _ _ _ _ _
f5 f6 f7 f8 _ _ _ _ _ _
f9 f10 f11 f12 _ _ _ _ _ _
_ _ _
)
;; Symbol layer
(deflayer symbol
_
S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-8 S-9 S-0
S-\ = - S-= S-- ` S-` S-scln ' S-'
_ \ S-[ S-] S-, S-. [ ] S-/ _
_ _ _
)
;; Aformentioned standard layer with combo binds for toggling back
;; to base layer.
(deflayer norm
esc
q w e r t y u i o p
a s d f g h j k l scln
z x c v b n m , . /
@ch_lalt spc @ch_ralt
)
;; Media layer
(deflayer md
_
_ _ _ _ _ _ _ _ _ _
del prev pp next ins mute vold volu brdn brup
_ _ _ _ _ _ _ _ _ _
_ _ _
)