Accepted ADR 0005 · 2026-11-08
#5. Vim modes and a Space leader
#Context
ganit's keys were Ctrl and Alt chords (Ctrl+M, Alt+1..4, Ctrl+S…) on top of Vyom's own (Tab, Ctrl+1..9). They were hard to remember, and they clashed with Vyom's tab keys. The user works in vim and asked for the same system here: modes, a Space leader, layers under it, and every key in normal mode only.
#Decision
- Two modes. INSERT types: only
Enter(run the sum, or save the conversion; it stays in INSERT) andEsc(to NORMAL) do anything else. NORMAL runs every other key and takes no typing. It opens in INSERT (start_modechanges that), and clicking a box enters INSERT. - Vim's keys where vim has one:
j/k,gg/G, counts (5k),yy/Y,p/P,x,D,cc/S,dd/u,gt/gT,q. The converter addsh/l(unit),H/L(kind) ands(swap). - Space is the leader, with layers:
ttabs,ycopy,mmemory,cclear,kkind,uunit,ssaved, plusrrates,ffullscreen,qclose,?help. After a prefix, a strip shows what comes next (which-key), and?lists every key of the tab. - The keymaps are data (
ganit/vim.py).scripts/keybinds.pywrites the# keybind:lines and the README's key tables from them, and CI checks they're up to date, so the keys, the strip, the help and the docs can't drift apart. - Vyom's tab keys (Tab, Ctrl+1..9, Ctrl+H/L) don't apply in ganit:
gt/gTandSpace treplace them. - Clearing everything asks first (
Space c t,Space s c:yconfirms). One deletion (dd) is undone withu. - Units are picked in ganit's own strip (
Space u f/t: type to filter, Enter picks). GTK's dropdown list can't take keys while the box keeps the focus.
#Consequences
- Every key is one or two letters, and the strip teaches them as you go.
- ganit's keys differ from the other Vyom tools' (their Tab and Ctrl+1..9 stay). Other tools can follow with the same table-driven approach.
- A key is changed in
vim.py, thenscripts/keybinds.pyis run.