Kakoune: Invert `!` and <a-!>

Created on 10 Dec 2018  路  9Comments  路  Source: mawww/kakoune

Hi,

I think it could make sense to invert the two ! and alt! mappings. Because of the search primitive /, it's now burned into my mind that alt means going backwards, but alt! inserts data after the selection.

Anybody else feels that way?

All 9 comments

Yes, same here

I implemented that, but realized how much it was going to break, like the clipboard integration scripts of the users. And I am wondering if the slight improvement in consistency we would get is really worth it. Additionally, I could see that in existring scripts, there are only uses of !, suggesting it is the most common form, favoring the status quo.

In a way, I think the proper fix would be to swap p and P, to make it consistent (my experience is that P is more common than p), but that would be an even bigger breaking change.

We're invoking different reasons, I'm saying alt generally means "backwards" in the editing language (and I also always use alt!, never just !), and it's more important to be consistent.

You're favouring ! for practical reasons, but users can always invert the mapping in their configuration if they preferred the previous behaviour once the mappings have been swapped, and others won't be surprised any more by the inconsistency that alt! doesn't act backwards, unlike other alt based primitives.

As for p and P, to me there's no real logic which should insert before/after aside from practicality, so that's up to you.

I think the proper fix would be to swap p and P, to make it consistent

I'm against this choice. This is well known behavior from very old times of Vi and insane amounts of clones. From design.asciidoc:

Kakoune is inspired by Vim, and should try to keep its commands close to Vim鈥檚 if there are no compelling reasons to change.

I don't see this change compelling enough, it also breaks my muscle memory scripts. Well since we can remap everything it's fine, but when there is too many things needed to remap that's when you become Emacs (and we already have Emacs, imagine if there were two of them. No one should have such power).

On the other hand <a-!> will make sense in terms of additional modifier needed to paste something before, just as p requires additional modifier.

p and P should remain in sync with o and O.

Sorry I was not very clear, I dont think it would be a good idea to change p and P, I mean that I see more the consistency between p/P and !/<a-!> as desirable than the idea that <a-!> would be "backward append output".

In a way, I am unconvinced that "insert before" is the backward version of "append after". I consider <a-!> as the "alternative insert before (which is append after)", the same way P is the alternative p (even if it does not use alt to express that, because the usual meaning of shift for expanding was not meaningful there).

That said, my argument in favor of consistency with p/P is actually in favor of that change, p pastes after, so ! should append after as well. What I was getting it is that if we did not care about breaking changes, swapping p and P to make the most common operation easier would be my preferred change.

Now I am confused... What should I do ? :smile:

If there's no consensus, then we leave things as they are and let users tweak the bindings in their configuration.

(even if it does not use alt to express that, because the usual meaning of shift for expanding was not meaningful there)

On that note, I think it's actually useful to select the pasted text sometimes. <a-p> does it, but it also does other things (i.e. concatenates all yanked text) which is not always desirable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dpc picture dpc  路  4Comments

akkartik picture akkartik  路  3Comments

basbebe picture basbebe  路  4Comments

MasterOfTheTiger picture MasterOfTheTiger  路  4Comments

abitofalchemy picture abitofalchemy  路  3Comments