Kakoune: X less ergonomic now that anchor does not jump to beginning of line

Created on 23 Sep 2017  路  5Comments  路  Source: mawww/kakoune

issue #1529 , and specifically commit 609a8ee8c793856b8c1e6b7c553ee3475ca8308f , changed the behavior of X so that it does not move the anchor to the beginning of the line.

i find this quite unergonomic, since i cannot select blocks of lines just by repeated presses of X. instead, i need to do xXXX or <alt-x>XXX, both of which require more dexterity.

ironzorg already kindly provided a script to restore the old behavior:

def old_X %{
    try %{
        exec -draft \; <a-k>\n<ret>
        exec X
    } catch %{
        exec <a-x><a-:>
    }
}

map global normal X ': old_X<ret>'

but i think the new X will result in a worse user experience for most users, so i think we should revert to the old behavior unless we have a good reason to.

Most helpful comment

I noticed this too, and I also found it somewhat difficult.
I had a think and remapped in a different way:

map global normal x X<a-x>
map global normal X K<a-x>

So, x extends down, X extends up.

With this change, the original x (select one line, then move to next with subsequent press) is gone,
and, for example, selecting only the second full line changes from xx to jx.
Essentially, x has become like the old X.

I don't mean to suggest this approach is suitable for everyone or in line with Kakoune's design in general,
only that it works fine for me and pressing only x for both selecting one line and extending lines is a comfortable way of performing a common task.

All 5 comments

I noticed this too, and I also found it somewhat difficult.
I had a think and remapped in a different way:

map global normal x X<a-x>
map global normal X K<a-x>

So, x extends down, X extends up.

With this change, the original x (select one line, then move to next with subsequent press) is gone,
and, for example, selecting only the second full line changes from xx to jx.
Essentially, x has become like the old X.

I don't mean to suggest this approach is suitable for everyone or in line with Kakoune's design in general,
only that it works fine for me and pressing only x for both selecting one line and extending lines is a comfortable way of performing a common task.

I found this change for the worse too with regards to Xs behaviour.

This has been changed again, hopefully to a better behaviour. I figured that with the recent changes that made end of lines far more likely to be selected, we needed a better behaviour for X, and rewrote a slightly different (hopefully more robust) selection merging behaviour.

To be more precise, we are mostly back to the previous behaviour where X will select the full line.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lenormf picture lenormf  路  3Comments

dpc picture dpc  路  4Comments

hwmack picture hwmack  路  4Comments

a12l picture a12l  路  3Comments

lenormf picture lenormf  路  4Comments