helix icon indicating copy to clipboard operation
helix copied to clipboard

Add an "inverse" command of sorts, similar to negative-argument in GNU Emacs

Open Kenneth-Mata opened this issue 1 year ago • 2 comments

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.

Kenneth-Mata avatar Dec 10 '23 21:12 Kenneth-Mata

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

plxty avatar Jul 18 '24 17:07 plxty

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

Kenneth-Mata avatar Jul 19 '24 00:07 Kenneth-Mata