a C implementation of Emacs Hydra package to be used in terminal.
key,name,command
lines then shows Terminal UI similar to Emacs π Hydra and prints the command to stdout.Spacemacs for example is an emacs configuration centered around π Hydra commands, with all user commands grouped as trees bound in a mnemonic way. for example:
space f f
space f D
space g s
Binding π Hydra to space
key in your terminal means pressing space
will make your terminal behave similar to spacemacs if you executed the output with eval
. this repo has a bash script hydra-completion.bash
which achieve this binding.
hydra
doesn't execute the command by default.fzf
and dmenu
.Clone it from github to your machine
git clone git@github.com:emad-elsaid/hydra.git
cd hydra
Build
make
Install
sudo make install
Export HYDRA
variable to your .bashrc
. it should have a list of hydras files. π Hydra example files are installed under /usr/share/hydra/hydras
.
Loading /usr/share/hydra-completion.bash
will bind hydra
to Space
key in your keyboard and will invoke hydra
when the line is empty.
For example to use the git
π Hydra:
export HYDRA="/usr/share/hydra/hydras/git"
source /usr/share/hydra/hydra-completion.bash
hydras
directory in this repo.a simple example can be as follow
g,Git,
gs,Status,git status
Git
command that doesn't execute a command under the key g
Status
under key s
inside g
that will execute the command git status
hydra
binary with a list of π hydra fileshydra hydras/git hydras/systemd hydras/github
To run tests execute
make run-test