Configurable keyboard mapping system design
Excellent research! Now let me consult the oracle for guidance on designing our keymapping system.
I have comprehensive research and oracle guidance. Now I'll create both documents.
Let me find the end of Chapter 12 to place the new chapter correctly:
Now I'll add the new Keymapping chapter and update the TOC. First, let me update the TOC:
Now add the new chapter before Appendix A:
Now let me create the feature design document:
Done! I've completed both deliverables:
Chapter 13: Keyboard Mapping and Command Dispatch added to EDITOR_UI_REFERENCE.md - covers core entities, key formats, storage strategies, context systems, dispatch architecture, conflict resolution, configuration formats, and platform considerations.
docs/feature/KEYMAPPING.md - comprehensive feature design document with:
- Module structure and data flow diagrams
- Complete Rust code for all types (
Keystroke,Keybinding,Command,Keymap,KeyContext) - TOML configuration format with examples
- Default bindings implementation
- Integration guide with your Elm architecture
- 8-phase implementation plan (~15h total)
- Command reference table
Key design decisions based on research from VS Code, Helix, Zed, and Neovim:
- Flat vector storage (simpler than trie, sufficient for editor-scale)
- TOML config (Rust-native, human-friendly)
modmodifier for platform-agnostic shortcuts- Simple
&&/!condition syntax (extensible later) - SmallVec for sequences (most bindings are 1-2 keys)