A lightweight Emacs package for making prefix key commands repeatable with which-key integration.
After executing a command within a prefix keymap, you stay in that keymap and can immediately press another key to execute another command without re-typing the prefix.
(use-package repeatable-lite
:ensure (:host github :repo "chiply/repeatable-lite")
:config (repeatable-lite-mode 1))(use-package repeatable-lite
:straight (:host github :repo "chiply/repeatable-lite")
:config (repeatable-lite-mode 1))Clone the repository and add it to your load-path:
(add-to-list 'load-path "/path/to/repeatable-lite")
(require 'repeatable-lite)
(repeatable-lite-mode 1)The main entry point is the ** macro, which wraps any interactive command to make it repeatable within its prefix keymap.
(general-define-key
"C-c w h" (** windmove-left)
"C-c w l" (** windmove-right)
"C-c w j" (** windmove-down)
"C-c w k" (** windmove-up))After pressing C-c w h to move left, you can press h/l/j/k repeatedly without the C-c w prefix. Press any key outside the keymap to exit.
- You press a prefixed key like
C-c w h - The wrapped command executes (e.g.,
windmove-left) - The prefix keymap stays active — which-key shows available keys
- Press another key in the map to repeat, or any other key to exit
- Emacs 30.1+ (which-key is built-in since Emacs 30.1)
GPL-3.0-or-later