I've been using Transient in a similar way, but for operations on specific filetypes I use vigorously. For example, I have a ruby transient which provides a single UI for my favourite refactoring functions across the LSP server and various Emacs packages I use. I find using transient this way allows me to streamline the more complex tasks I perform by giving me an easy to conceive UI which hides the detail when I'm knee deep in bugs - but all the power of Emacs is still there under the hood when I need it. I suspect many people would get further with Emacs if they learned use-package and transient instead of picking up Doom Emacs or Space Emacs (which was how I started; they are great projects in their own right but can be limiting due to their own DSL which is a departure from vanilla Emacs).
emacs' discoverability has been quite terrible. A couple years back I wrote half of a package to do ascii art before I discovered artist-mode. And I had been using emacs for close to a decade by then. This year I discovered ace-window had hidden keybindings (C-x o then instead of choosing the window you want, type '?' to get the dispatch menu). Again, I've been using ace-window for about a decade. Adding a transient dispatch menu to Isearch would be great. I'd also suggest a more global keybinding for hidden dispatch menu (I suggest M-? for dispatch menus when using the minibuffer and ? for other modes).
Also this blog post makes me want to make me transform my embark to using transient
Transient is, if I recall, a big part of magit’s special sauce. It’s a great library for interactive chording.
Modality or contextual keymaps is indeed a very powerful concept and it seems like the only way to have usable complicated keybinding schemes, so nice that this stacked/transient override was added
Hi folks! Great to see all the interest in my post. Feel free to ask me questions/post observations related to it.
> The default keybindings for said commands are cursed. (Seriously, C-M-@ to call isearch-query-replace-regexp ?)
BTW, this isn't only a problem with `isearch`. I suspect that other multiple-simultaneous-keypresses tend to be hard on most people's hands. Which can be bad for your typing-oriented career, and for other humans uses of hands.
Some alternatives in Emacs:
* Try to press the modifier key(s) with one hand, and the non-modifier key with the other.
* If the modifier(s) require contorting in uncomfortable ways, consider whether moving from home row is easier.
* When an Emacs key sequence includes the "Meta" modifier (`M-`), consider whether pressing and releasing the Esc key first, and then doing the remaining key/combo, is easier.
* Make a better key binding. Examples:
(global-set-key [f5] 'call-last-kbd-macro)
(global-set-key [f12] 'undo)
(global-set-key [XF86Back] '(lambda ()
(interactive)
(other-window -1)))
* Learn fancier Emacs features which might mean not having to type this or not as often (keyboard macros is just one).* Use or write a function or package that automates the higher-level task. For writing your own, you can learn from one of these two manuals, and just start experimenting in your running Emacs: https://www.gnu.org/software/emacs/manual/html_node/eintr/ https://www.gnu.org/software/emacs/manual/html_node/elisp/
Related: to create submenu with sticky keys, there is Hydra: https://github.com/abo-abo/hydra
> The default keybindings for said commands are cursed. (Seriously, C-M-@ to call isearch-query-replace-regexp ?)
If only software allowed to be shipped with a different set of defaults or more convenient alternatives...
> The default keybindings for said commands are cursed.
Default keybindings are a curse.
Software in general would be so much better if keybindings were always explicitly part of the user's configuration. Despite that being technically the case in Emacs, the reality just isn't as practical as it should be.
Every default keybinding brings an assumption into UI/UX. That assumption can never be removed: it can only be moved.
Oh this is actually very cool. I didn't know about Transient or that I can create a custom workflow menu. Will be really nice for, just like the article, those commands I don't remember or that have vast numbers of options.
Thank you for sharing, I found the article very useful.