A very simple keybinding library. As of this writing, it’s just one function.
I just use straight+use-package like so:
(use-package skey
:straight (gumshoe :type git
:host github
:repo "Overdr0ne/skey"
:branch "main"))
(skey-define-keys
'(c-mode-map)
; note the backtick so we can use the comma to evaluate perspective-map
`(
("C-M-a" c-beginning-of-defun)
([remap end-of-defun] c-end-of-defun)
("M-p" ,project-prefix-map)))
(setq +repl-maps '(term-mode-map shell-mode-map term-raw-map geiser-repl-mode-map))
(skey-define-keys
(cl-set-difference +repl-maps '(term-mode-map))
`(("M-p" ,project-prefix-map)))
Notice, you can’t really achieve the above with keymap inheritance.
- https://github.com/noctuid/general.el General does much the same thing as this package, and much more, providing many facilities for evil users– all at the cost of a lot of added complexity. Further, because of the syntax of it’s key definers, you can’t nest functions to generate lists of keybindings.
- use-package’s `:bind`: I suspect this is what most people use. Works well enough if you only rebind on init, and don’t mind lots of duplicate code for all the bindings common between multiple keymaps.