Skip to content

Instantly share code, notes, and snippets.

@partrita
Last active April 21, 2025 06:24
Show Gist options
  • Save partrita/0ba8918f8e2094c1a7ddd05b4bdbd826 to your computer and use it in GitHub Desktop.
Save partrita/0ba8918f8e2094c1a7ddd05b4bdbd826 to your computer and use it in GitHub Desktop.
A keyboard favor computing
;; check out, https://github.com/jtroo/kanata
;; Caps lock key for hangul, left alt <-> left ctrl key for ergonomics
;; pressed LControl+Space+Escape, exiting.
;; (defcfg
;; process-unmapped-keys yes
;; )
(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
)
(deflocalkeys-win
han 21
)
(deflocalkeys-linux
han 100 ;; alt_r
)
(defvar
;; Note: consider using different time values for your different fingers.
;; For example, your pinkies might be slower to release keys and index fingers faster.
tap-time 200
hold-time 200
)
(defalias
;; toggle layer aliases
nav (layer-toggle nav)
win (layer-switch win)
mac (layer-switch mac)
col (layer-switch col)
;; tap-hold keys with letters for tap and layer change for hold
spl (tap-hold-release $tap-time $hold-time spc @nav)
;; tap for lctl, hold for caps
cap (tap-hold-release $tap-time 2000 han caps)
;; home-row shift
f (tap-hold $tap-time $hold-time f lsft)
j (tap-hold $tap-time $hold-time j rsft)
;; Mouse movement actions with linear acceleration.
;;The first number is the interval in milliseconds between mouse actions.
;; The second number is the time in milliseconds for the distance to linearly ramp up from the minimum distance to the maximum distance.
;; The third number is the minimum distance traveled per interval in pixels.
;; The fourth number is the maximum distance traveled per interval in pixels.
ma↑ (movemouse-accel-up 1 1000 1 5)
ma← (movemouse-accel-left 1 1000 1 5)
ma↓ (movemouse-accel-down 1 1000 1 5)
ma→ (movemouse-accel-right 1 1000 1 5)
;; Mouse wheel actions.
;; The first number is the interval in milliseconds between scroll actions. ;; The second number is the distance in some arbitrary unit. Play with the parameters to see what feels correct. Both numbers must be in the range 1-65535
;; In both Windows and Linux, 120 distance units is equivalent to a single notch movement on a physical wheel. In Linux, not all desktop environments
;; support the REL_WHEEL_HI_RES event so if you experience issues with `mwheel` actions in Linux, using a distance value that is multiple of 120 may help.
mwu (mwheel-up 50 120)
mwd (mwheel-down 50 120)
mwl (mwheel-left 50 120)
mwr (mwheel-right 50 120)
)
(deflayer win
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
@cap a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lmet lalt @spl ralt rmet rctl
)
(deflayer mac
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
@cap a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lalt lmet lctl @spl ralt rmet rctl
)
(deflayer col
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ] \
@cap a r s t g m n e i o ' ret
lsft z x c d v k h , . / rsft
lalt lmet lctl @spl ralt rmet rctl
)
(deflayer nav
lrld @win @mac @col XX XX XX XX XX XX XX XX XX del
_ mlft @ma↑ mrgt @mwu XX XX XX XX XX XX XX XX XX
XX @ma← @ma↓ @ma→ @mwd XX left down up rght XX XX _
_ XX XX XX XX home pgdn pgup end XX XX _
_ _ _ _ _ _ _
)

Introduction

This is my configuration files of these programs.

  • Kanata: A cross-platform software keyboard remapper for Linux, macOS and Windows.
  • Komorebi: Tiling Window Management for Windows.
  • Rectangle Mac: Automatic tiling window manager for Mac.

방향키 문제

주로 텐키리스 키보드를 사용하는데 방향키가 미세하게 다르기도 하고 어떤 경우는 왼쪽 오른쪽 키를 나눠서 Page up, page down을 만들어 놨음. 이게 생각보다 적응하기 힘들기도 하고 방향키의 사용빈도가 높음에도 불구하고 왼손이 자주 이동하기가 불편함. 따라서 Vim 스타일로 Homerow 쪽으로 맵핑을 만들어서 사용하기 시작함.

한영 전환

여러 OS를 동시에 사용하다보면 한영전환키가 모두 달라서 불편한 점이 많음. 특히 리눅스와 맥에서 문제가 심각.

소프트웨어적 해결책

  1. 한영 전환을 별도의 프로그램을 사용해 전환. 한영키를 caplock자리에 매핑
  2. 한영키 사용 대신에 ctrl+space 키 조합으로 사용.

물리적인 해결책

KeyChron B1 pro 키보드 사용

  • Capslock 키를 메크로키로 변경해서 사용(ctrl + space): 한영전환 딜레이를 제거하기 위함.
.shell powershell
# located ~\.config\whkdrc
# Reload whkd configuration
# alt + o : taskkill /f /im whkd.exe && start /b whkd # if shell is cmd
alt + o : taskkill /f /im whkd.exe; Start-Process whkd -WindowStyle hidden # if shell is pwsh / powershell
alt + shift + o : komorebic reload-configuration
alt + q : komorebic close
alt + m : komorebic minimize
# Focus windows
alt + h : komorebic focus left
alt + j : komorebic focus down
alt + k : komorebic focus up
alt + l : komorebic focus right
alt + oem_4 : komorebic cycle-focus previous # oem_4 is [
alt + oem_6 : komorebic cycle-focus next # oem_6 is ]
# Move windows
alt + shift + h : komorebic move left
alt + shift + j : komorebic move down
alt + shift + k : komorebic move up
alt + shift + l : komorebic move right
alt + shift + return : komorebic promote

Comments are disabled for this gist.