helix
helix copied to clipboard
Add an "inverse" command of sorts, similar to negative-argument in GNU Emacs
I think it would greatly simplify the editing model (not in reducing keybindings but in "backwards" operations), meow, an editing model for emacs inspired by Kakoune - Helix, uses - (essentially doing negative-argument) for commands that would use Shift + Letter in Helix, so something like -f would do Shift + f, - x wil extend to previous line, - n previous match in a search and so forth, what i find more comfortable about this, is that the - is sticky in some way, meaning that further presses will stay in the direction implied by the -, and to inverse it again, is as simple as pressing -. I tried to get this behavior by having mapping in keys.normal.minus, but this method will require - for every press, defeating the initial point of an universal inverse command.
It wouldn't need to be precisely on the - character to not break backwards compatibility, but a command in that style so the editing continues to be composable.
Here I have implemented some of the commands of this negative-argument, and make it sticky. But the implementation is kind of "dirty", as only for personal use currently, maybe a PR later :)
https://github.com/hyptrap/helix/commit/d0eff76f9bfc7b57dfc81b3855705723184f45e5
I'll try it and I think its very cool, is really what makes me stay in Emacs, you definitely should make a PR, perhaps as some sort of option/toggle that you add in config.toml