-
-
Save lucaspwbx/85e1318a4a1ef195c16d3bcca2325cdd to your computer and use it in GitHub Desktop.
Show free key bindings in Emacs (for the current mode)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq free-keys-modifiers (list "C" "M" "C-M")) | |
(setq free-keys-keys "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.,/§1234567890-=[];'\\`±!@#$%^&*()_+}{:\"|?><~") | |
(defun free-keys () | |
(interactive) | |
(let ((buf (get-buffer-create "*Free keys*"))) | |
(display-buffer buf) | |
(with-current-buffer buf | |
(erase-buffer) | |
(mapc (lambda (modifier) | |
(insert "\nFree keys with modifier " modifier "\n=========================\n") | |
(mapc (lambda (key) | |
(let* ((full-name | |
(concat modifier "-" (char-to-string key))) | |
(binding | |
(key-binding (read-kbd-macro full-name)))) | |
(when (not binding) | |
(insert | |
full-name | |
" maps to " | |
(symbol-name binding) | |
"\n")))) | |
free-keys-keys)) | |
free-keys-modifiers) | |
(setq buffer-read-only t) | |
(make-local-variable 'buffer-read-only) | |
(goto-char 0)))) | |
(provide 'free-keys) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment