$ show S-Sigdel/vimhjkl
vimhjkl is a Vim technique trainer that drills advanced Vim skills (dot command, text objects, registers, macros, Ex commands) using real vim/nvim as a subprocess. It features a CLI with interactive menu (j/k navigation, vim-style counts) and four practice modes: Learn, Blind, Practice, Grind, and Review. The application uses a spaced repetition system (Leitner boxes) to schedule skill reviews based on keystroke efficiency. It includes 66 skills across 230 challenges, with a curriculum defined in JSON and generated by a separate build system. The codebase is pure Python stdlib with zero third-party dependencies, and supports internationalization (Chinese shipped) with an AI translation pipeline. The architecture is modular: CLI entry point, engine for session logic, grader for vim subprocess management, store for progress persistence, and TUI for terminal rendering. The repository also contains build scripts for curriculum generation and packaging (Homebrew, AUR).
The LLM identified 4 files worth highlighting for reuse:
Provides color-safe ANSI rendering functions (visible_len, truncate_visible, wrap_plain, progress_bar, rnu_gutter) and a signal-safe raw mode guard that restores cooked tty on SIGTSTP and re-enters raw on resume. All functions are self-contained with no external dependencies, making them reusable in any terminal application.
Translates Vim-style key notation (e.g., '<Esc>', '<C-x>') into raw byte sequences. Used by the grader and remap folding logic. Pure function, no internal imports, easily extractable for any project needing to parse or generate Vim key sequences.
Implements atomic JSON writes using a temporary file and os.replace, ensuring data integrity against partial writes. Provides load/save for skills and progress. The _atomic_write helper is a reusable pattern for safe file persistence in any Python application.
Contains the remap_blocks_skill function that checks if a user-defined key remap shadows a taught key in both key_commands and actual solutions. Also implements the Leitner box spaced repetition logic with ease multipliers and softened demotion. The collision detection pattern is reusable for any configurable keybinding system.