Skip to content

Instantly share code, notes, and snippets.

@mmarshall540
Last active May 27, 2025 15:42
Show Gist options
  • Save mmarshall540/a12f95ab25b1941244c759b1da24296d to your computer and use it in GitHub Desktop.
Save mmarshall540/a12f95ab25b1941244c759b1da24296d to your computer and use it in GitHub Desktop.
Missing Which-key Prefix descriptions
;; By default, Which-key doesn't give much help for prefix-keys. It
;; either shows the generic description, "+prefix", or the name of a
;; prefix-command, which usually isn't as descriptive as we'd like.
;;
;; Here are some descriptions for the default bindings in `global-map'
;; and `org-mode-map'.
(which-key-add-key-based-replacements
"<f1> 4" "help-other-win"
"<f1>" "help"
"<f2>" "2-column"
"C-c" "mode-and-user"
"C-h 4" "help-other-win"
"C-h" "help"
"C-x 4" "other-window"
"C-x 5" "other-frame"
"C-x 6" "2-column"
"C-x 8 '" "´-ÁĆÉÍŃÓŚÚÝŹ"
"C-x 8 * SPC" "nb-space"
"C-x 8 *" "punct-curr"
"C-x 8 ," "„-‚-¸-ĄÇŅŞ"
"C-x 8 -" "soft-hyphen"
"C-x 8 ." "·-ż"
"C-x 8 /" "÷-≠-ÅÆŁØ"
"C-x 8 1 /" "½-¼"
"C-x 8 1" "†-½-¼"
"C-x 8 2" "‡"
"C-x 8 3 /" "¾"
"C-x 8 3" "¾"
"C-x 8 = /" "Ǣ-ǣ"
"C-x 8 =" "¯-ĀĒḠĪŌŪȲǢ"
"C-x 8 A" "Æ"
"C-x 8 N" "№"
"C-x 8 O" "Œ-œ"
"C-x 8 SPC" "nb-space"
"C-x 8 \"" "¨-ÄËÏÖẞÜÿ"
"C-x 8 ^ ^" "caron"
"C-x 8 ^" "sup-circ-caron"
"C-x 8 _ H" "nb-hyphen"
"C-x 8 _ f" "fig-dash"
"C-x 8 _ h" "hyphen"
"C-x 8 _ m" "em-dash"
"C-x 8 _ n" "en-dash"
"C-x 8 _ q" "horiz-bar"
"C-x 8 _ −" "minus"
"C-x 8 _" "sub-dash-≤≥ªº"
"C-x 8 `" "ÀÈÌÒÙ"
"C-x 8 a" "←-↔-→-æ"
"C-x 8 e" "emoji"
"C-x 8 ~" "≈-ÃÐÑÕÞ-¬"
"C-x 8" "insert-special"
"C-x C-k C-q" "kmacro-counters"
"C-x C-k C-r a" "kmacro-add"
"C-x C-k C-r" "kmacro-register"
"C-x C-k" "keyboard-macros"
"C-x RET" "encoding/input"
"C-x a i" "abbrevs-inverse-add"
"C-x a" "abbrevs"
"C-x n" "narrowing"
"C-x p" "projects"
"C-x r" "reg/rect/bkmks"
"C-x t ^" "tab-bar-detach"
"C-x t" "tab-bar"
"C-x v M" "vc-mergebase"
"C-x v b" "vc-branch"
"C-x v" "version-control"
"C-x w ^" "window-detach"
"C-x w" "window-extras"
"C-x x" "buffer-extras"
"C-x" "extra-commands"
"M-g" "goto-map"
"M-s h" "search-highlight"
"M-s" "search-map")
;; Some packages add a prefix-key upon loading. If you know of other
;; built-in packages that have this behavior, please let me know, so I
;; can add them.
(with-eval-after-load 'edebug
(which-key-add-key-based-replacements
edebug-global-prefix "edebug")) ; default = "C-x X"
(with-eval-after-load 'gud
(which-key-add-key-based-replacements
gud-key-prefix "gud")) ; default = "C-x C-a"
(with-eval-after-load 'page-ext
(which-key-add-key-based-replacements
"C-x C-p" "page-extras"))
;; Org-mode provides some additional prefix-keys in `org-mode-map'.
(with-eval-after-load 'org
(which-key-add-keymap-based-replacements org-mode-map
"C-c \"" "org-plot"
"C-c C-v" "org-babel"
"C-c C-x" "org-extra-commands"))
@orontee
Copy link

orontee commented May 5, 2025

Thank you for this!

There's gud-key-prefix mapped to \C-x\C-a that's added after (require 'gud).

@orontee
Copy link

orontee commented May 5, 2025

The emoji prefix map (mapped to C-x 8 e) is missing.

@mmarshall540
Copy link
Author

Added now. Thank you!

@artelse
Copy link

artelse commented May 8, 2025

"C-x X" "edebug"

@mmarshall540
Copy link
Author

"C-x X" "edebug"

Added. Thank you!

@mmarshall540
Copy link
Author

mmarshall540 commented May 10, 2025

Added more descriptions for the child and grandchild-prefixes under "C-x 8", as well as some of the character variants that are hard to identify visually, like non-breaking hyphens.

Should make it somewhat easier to find and insert characters not found on your keyboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment