What does HackerNews think of hydra?

make Emacs bindings that stick around

Language: Emacs Lisp

You really don't need any Emacs keybinding if you set up Evil. Like how I use Emacs on mobile, because typing modifier keys is harder, I just use basic vi commands and bind everything else I need to single-character Hydras[0]. If you don't know vi you should probably learn basic commands like copy and save which emacs-tutorial is more than enough for. Actual Emacs and it's ecosystem is just too good to let something that simple deter you.

[0] https://github.com/abo-abo/hydra

You could use hydra [1] to set up something like this pretty easily. I did have a setup like this once, but found that escaping the 'modes' with an extra keypress when I only typically wanted to do one or two operations wasn't particularly nice.

[1] https://github.com/abo-abo/hydra

In about 70-80% of the cases, using ido or helm, with some guesses on what the command name may contain, is enough to find me what I need.

But yes, to be frank, my productivity in Emacs really took off once I started memorizing things with flashcards. I currently have 603 cards for Emacs (including elisp).

(And telling a newbie that would cause a lot of despair!)[2]

The other thing that really helped is I started using/making hydras.[1] So now when I encounter a new, interesting mode, instead of memorizing lots of command names or keybindings, I just build my own custom menus.

[1] https://github.com/abo-abo/hydra

[2] But it really shouldn't. Emacs, with all its packages, and modes, is like a language with all its libraries, and not just the standard ones. Remembering all the commands/keybindings is akin to expecting someone to know all the APIs in all the libraries. It's OK if you don't. Most people don't.

A cluster of Emacs keybindings that share a common prefix, implemented using the hydra library:

https://github.com/abo-abo/hydra

And which is why I abandoned both Windows and Linux for using Emacs as my OS :).

No, seriously. I try to port all my workflow to Emacs, because with all the power and consistency of that keyboard-driven platform, I can finally put my muscle memory to use.

Beyond that, I finally developed a habit of automating annoyances away. Today, if I do something frequently and find it annoying, I fix it with a script. Be it elisp (Emacs), CL (Linux - I use StumpWM as my WM), or AutoHotkey (Windows).

--

Actually, some random recent examples:

- I frequently deal with Lisp code that outputs large structured or semistructured blobs of text; at some point I decided I need a quick way to pipe such output to a separate Emacs buffer: https://gist.github.com/TeMPOraL/8715c9dd9837e0b601d1cdce059....

- At my previous workplace, I found myself pasting some strings to various communications channels quickly. Since I already used AutoHotkey to remap Caps Lock to CTRL, this is what I came with (and later expanded): https://gist.github.com/TeMPOraL/d330edccf8ba9a2b13d01b4e7f1....

- Speaking of whipping up ad-hoc UIs on the fly, the Hydra package (https://github.com/abo-abo/hydra) is perfect for that in Emacs. My config becomes increasingly full of ad-hoc popup menus like these: https://gist.github.com/TeMPOraL/d3a0b3065c43d41526bcb3fe2c9....

- StumpWM - https://github.com/TeMPOraL/conffiles/blob/master/stumpwm/.s... - unlike my Emacs config, most of this was written by me, on the fly, to fix some annoyances.

The point of giving those examples, beyond obviously showing off :), is that this is what IMO good software enables. Improving your life on the fly, one simple binding or one simple script at a time. Scripting isn't only for shell commands. It's definitely useful for UI experience as well. I regret it took me that long to figure this out.

This is also why I try to port as much of my workflow as I can to Emacs. It's because Emacs makes such modifications seem trivial. If you need something to interoperate more, you can glue it with together with a little bit of Elisp. If you need something new, you can probably add it with a little bit of Elisp in no time. Emacs, being a runtime-modifiable, introspectable and tremendously well documented system with a decent REPL, makes this quick and relatively painless.