github abo-abo/hydra 0.10.0
hydra 0.10.0

latest releases: 0.15.0, 0.14.0, 0.13.6...
9 years ago

New features

Define Hydra heads that don't show up in the hint at all

This can be done by setting the head's hint explicitly to nil, instead of the usual string. For
instance, if you always tend to bind the arrows to hjkl, there's no point to show a hint
for them.

Use a dedicated window for Hydra hints

Since version 0.10.0, setting hydra-lv to t (the default setting) will make it use a dedicated
window right above the Echo Area for hints. This has the advantage that you can immediately see any
message output from the functions that you call, since Hydra no longer uses message to display
the hint. You can still have the old behavior by setting hydra-lv to nil.

Allow duplicate functions in heads

Duplicate functions will be concatenated in the hint.

Example:

(defhydra hydra-zoom (global-map "<f2>")
  "zoom"
  ("g" text-scale-increase "in")
  ("l" text-scale-decrease "out")
  ("0" (text-scale-set 0) "reset")
  ("1" (text-scale-set 0) :bind nil)
  ("2" (text-scale-set 0) :bind nil :color blue))

Here, the hint will be: "zoom: [g]: in, [l]: out, [0 1 2]: reset.", and "2" will be colored blue.

Add option to font-lock defhydra

If you want to nicely font-lock your defhydra statements, just add this to your config:

(require 'hydra)
(hydra-add-font-lock)

Additionally, defhydra is now to be indented as a defun, so it will be indented like this:

(defhydra hydra-goto-line (global-map "M-g"
                           :pre (linum-mode 1)
                           :post (linum-mode -1)
                           :color blue)
  ("g" goto-line "line")
  ("c" goto-char "char"))

Note that the indentation of the body argument is as if it was data and not code, i.e. the proper
one.

Incompatible changes

The macro hydra-create, as well as the variables that were supposed to be used with it
(hydra-example-text-scale, hydra-example-move-window-splitter, hydra-example-goto-error,
hydra-example-windmove) were removed. All the functionality is still there in hydra-examples.el
with the better defhydra macro.

Don't miss a new hydra release

NewReleases is sending notifications on new releases.