github abo-abo/hydra 0.8.0
hydra 0.8.0

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

This release introduces a new color: amaranth, in addition to the previously available
red and blue.

According to Wikipedia:

The word amaranth comes from the Greek word amaranton, meaning "unwilting" (from the
verb marainesthai, meaning "wilt"). The word was applied to amaranth because it did not
soon fade and so symbolized immortality.

Hydras with amaranth body are impossible to quit with any binding except a blue head.
A check for at least one blue head exists in defhydra, so that you don't get stuck by accident.

Here's an example of an amaranth Hydra:

(global-set-key
 (kbd "C-z")
 (defhydra hydra-vi
     (:pre
      (set-cursor-color "#40e0d0")
      :post
      (set-cursor-color "#ffffff")
      :color amaranth)
   "vi"
   ("l" forward-char)
   ("h" backward-char)
   ("j" next-line)
   ("k" previous-line)
   ("e" move-end-of-line :color blue)
   ("q" nil "quit")))

The only way to exit it, is to press either q or e. No other methods will work.
You can use an amaranth Hydra instead of a red one, if for you the
cost of being able to exit only though certain bindings is less than the cost of
accidentally exiting a red Hydra by pressing the wrong prefix.

Note that it does not make sense to define a singe amaranth head, so this color can only
be assigned to the body. An amaranth body will always have some amaranth heads and some
blue heads (otherwise, it's impossible to exit), no reds.

Don't miss a new hydra release

NewReleases is sending notifications on new releases.