
Show HN: A high-level Lisp configurator for the Ergodox keyboard - molteanu
https://github.com/mihaiolteanu/mugur
======
molteanu
I've literally shed a tear when I've unboxed my Ergodox keyboard and saw with
my own eyes that one key can do multiple things. Tap it once and it's a Space,
hold it down and it acts like Control. Little by little, I've changed my whole
way of looking at a keyboard, from minimizing hand movement to playing with
layers, until I've finally realized that it doesn't really matter what is
written on the key, since you can fully program it. And after a while, I was
wanting a way to have the keyboard and all its layers in front of me, as text,
and to just simply say in a consistent way: "I want this key to switch
buffers, that is, call `other-window` when I press it" or, "Have this key jump
to previous position, that is, simulate a `C-u C-space` when I press it". Of
course, all the other Ergodox features should be available by specifying keys
in this way.

I eventually implemented this as an Emacs package called mugur. With mugur,
you only have to define one big list in your init.el file, with all the layers
and keys in a single place. No other extra code needed. After playing around
with it for a bit, I find it is easier and faster to explore all kinds of
usage scenarios to squeeze every bit of potential from these wonderful
programmable machines.

I'm already using mugur to generate the Ergodox configuration that I've used
to write by hand before. By hand, meaning writing C code. I'm expecting there
to still be bugs and little wrinkles, but now, at the beginning of an
enterprise, it is the best time to try things out and ask for missing features
or point out horrible mistakes. So I'll gladly hear your thoughts on it. I'm
only supporting Ergodox at the moment since this is what I own and this is
what I use. If there really is a need for other keyboards, it is my belief
that that can be fixed in the future. If there is no such need, there is no
point for me coding stuff for a distant future that never comes.

Mihai

~~~
fao_
> And after a while, I was wanting a way to have the keyboard and all its
> layers in front of me, as text, and to just simply say in a consistent way:
> "I want this key to switch buffers, that is, call `other-window` when I
> press it" or, "Have this key jump to previous position, that is, simulate a
> `C-u C-space` when I press it".

I feel like there's an entire subgroup of EMACS users rediscovering why vim is
so popular.

Of course, this doesn't account for the motion/verb aspect (where you map
commands to verbs, like `dw` (delete word) or `d}` (delete paragraph)), but
what you're essentially talking about is a form of modality, albeit universal
modality for your keyboard.

------
nickdrozd
I'm not an Ergodox user (yet), but this looks pretty cool. You might consider
making it more obvious how to use it. Is it a compiler? Or some kind of
interpreter? I gather that there is a Lispy configuration language for the
keyboard layers, and somehow that configuration gets to the keyboard, but I
don't understand how. The example from your config didn't clarify it for me.

~~~
molteanu
You define your layers with 'mugur-keymap' as in the example, and then you
generate the C code with 'mugur-generate'. After that, you do what every
Ergodox user does with its C code: flash it. The process is explained on the
Ergodox and the qmk (the firmware) documentation pages, so I'm not gonna
copy/paste it or give it an interpretation for lazy users in the readme.

If you do get an Ergo, eventually, and you want to try mugur, I'll be more
than happy to help if you have problems with it or need new features. Open a
ticket or drop me a line.

------
xupybd
Does this work for the ergodox infinity?

~~~
molteanu
It should. It has the same number of keys as the Ez. Let me know if you try it
and have problems with it.

