Discoverability

From WikEmacs
Revision as of 10:56, 6 June 2016 by Elvince (talk | contribs) (→‎Hydra: img)
Jump to navigation Jump to search

This page will try to list emacs' features and packages that help in auto discoverability. So if you don't know much about emacs' keybindings, commands, i.e., potential, you can have the information come to you and you just have to let you guide.

Emacs builtins

Emacs by default is built around this idea of discoverability. It is self-documented. See C-h ?.

Emacs 25

Emacs 25 comes with even better introspection (see this article).

Packages

Hydra

An Hydra is a great package by abo-abo that "can be used to tie related commands into a family of short bindings with a common prefix - a Hydra."

You can pick hydras around (see the wiki on github). Some of them "just" group keybindings together, others provide a full list of a mode to help discoverability (for example, the ibuffer Hydra can be called immediately when we enter ibuffer mode and show all keybindings).

Hydras are also very easy to write. This is a simple one:

(defhydra hydra-zoom (global-map "<f2>")
  "zoom"
  ("g" text-scale-increase "in")
  ("l" text-scale-decrease "out"))

This is the screenshot of a more complete one:

Hydra-buffer.png