about | blog | config | notes | github

1. which-key: Keybindings Popup Display


"which-key is a minor mode for GNU/Emacs that displays the key bindings following your currently entered incomplete command (a prefix) in a popup. For example, after enabling the minor mode if you enter C-x and wait for the default of 1 second the minibuffer will expand with all of the available key bindings that follow C-x (or as many as space allows given your settings). This includes prefixes like C-x 8 which are shown in a different face. Screenshots of what the popup will look like are included below. which-key started as a rewrite of guide-key-mode, but the feature sets have diverged to a certain extent." - justbur

2. Package Install

(use-package which-key
  :diminish which-key-mode
  :init (which-key-mode))

There are a couple of different setup modes that we can configure:

Which Key Setup Mode Description
which-key-setup-side-window-bottom Popup which-key window at the bottom
which-key-setup-side-window-right Popup which-key window at the top
which-key-setup-side-window-right-bottom Favor right side, but if too big use bottom
which-key-setup-minibuffer Use minibuffer for which-key window

Since I'm still learning emacs, lets make the delay a little small so that we can quickly see what options are available to us. The secondary delay is for subsequet key strokes.

(setq which-key-idle-delay 1.0)
(setq which-key-idle-secondary-delay 0.0)

Make sure to provide the module.

(provide 'init-which-key)

Created: 2021-11-13

Emacs 26.1 (Org mode 9.5)