GNU ELPA - hydra

hydra

Description
Make bindings that stick around.
Latest
hydra-0.14.0.tar, 2017-Jul-22, 160kB
Maintainer
Oleh Krehel <ohwoeowho@gmail.com>
Home page
https://github.com/abo-abo/hydra
Browse ELPA's repository
CGit or Gitweb

To install this package, run in Emacs:

M-x package-install RET hydra RET

Full description

This package can be used to tie related commands into a family of
short bindings with a common prefix - a Hydra.

Once you summon the Hydra (through the prefixed binding), all the
heads can be called in succession with only a short extension.
The Hydra is vanquished once Hercules, any binding that isn't the
Hydra's head, arrives.  Note that Hercules, besides vanquishing the
Hydra, will still serve his orignal purpose, calling his proper
command.  This makes the Hydra very seamless, it's like a minor
mode that disables itself automagically.

Here's an example Hydra, bound in the global map (you can use any
keymap in place of `global-map'):

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

It allows to start a command chain either like this:
"<f2> gg4ll5g", or "<f2> lgllg".

Here's another approach, when you just want a "callable keymap":

    (defhydra hydra-toggle (:color blue)
      "toggle"
      ("a" abbrev-mode "abbrev")
      ("d" toggle-debug-on-error "debug")
      ("f" auto-fill-mode "fill")
      ("t" toggle-truncate-lines "truncate")
      ("w" whitespace-mode "whitespace")
      ("q" nil "cancel"))

This binds nothing so far, but if you follow up with:

    (global-set-key (kbd "C-c C-v") 'hydra-toggle/body)

you will have bound "C-c C-v a", "C-c C-v d" etc.

Knowing that `defhydra' defines e.g. `hydra-toggle/body' command,
you can nest Hydras if you wish, with `hydra-toggle/body' possibly
becoming a blue head of another Hydra.

If you want to learn all intricacies of using `defhydra' without
having to figure it all out from this source code, check out the
wiki: https://github.com/abo-abo/hydra/wiki. There's a wealth of
information there. Everyone is welcome to bring the existing pages
up to date and add new ones.

Additionally, the file hydra-examples.el serves to demo most of the
functionality.

Old versions

hydra-0.9.0.tar2015-Feb-1080.0kB
hydra-0.8.0.tar2015-Feb-0970.0kB
hydra-0.6.1.tar2015-Feb-0550.0kB
hydra-0.5.0.tar2015-Feb-0440.0kB
hydra-0.3.1.tar2015-Jan-2520.0kB
hydra-0.3.0.tar2015-Jan-2220.0kB
hydra-0.13.5.tar2016-Mar-0580.0kB
hydra-0.13.4.tar2015-Dec-08 140kB
hydra-0.13.3.tar2015-Oct-17 140kB
hydra-0.13.2.tar2015-May-02 130kB
hydra-0.13.1.tar2015-Apr-17 120kB
hydra-0.12.1.tar2015-Mar-29 140kB
hydra-0.11.0.tar2015-Mar-07 130kB