Kakoune: Make Alt + h and Alt + l a bit more smart

Created on 7 Mar 2019  Â·  3Comments  Â·  Source: mawww/kakoune

How about Alt + h and Alt + l selecting to, the _content boundaries_ first, then the _line boundaries_?

Examples

··This is [an] example¬

Example 1 – Executing Alt + h:

··[This is an] example¬

Example 2 – Executing Alt + h:

[··This is an] example¬

Example 3 – Executing Alt + l:

[··This is an example]¬

Example 4 – Executing Alt + l:

[··This is an example¬]

Most helpful comment

I think what's really missing is a proper line text-object. If it's x then you can use regular combo like [x, <a-}>x…

All 3 comments

I think what's really missing is a proper line text-object. If it's x then you can use regular combo like [x, <a-}>x…

What about:

····This is a[n] example··→   ¬

Alt+l: always selects until leading whitespace

····[This is an] example··→   ¬

Alt+L: always selects to the beginning of the line

[····This is an] example··→   ¬

Alt+h: always selects till trailing whitespaces

[····This is an example]··→   ¬

Alt+H: always selects till end of the line

[····This is an example··→   ¬]

This matches other keys behavior, where key tryes to be smart, but when another modifier is involved it becomes non-smart, like smart Shift+8 and non-smart Shift+Alt+8. Although it involves more chording.

I prefer the smart version interactively.

And for scripting g, h / G, h / g, l / G, l.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Delapouite picture Delapouite  Â·  4Comments

MasterOfTheTiger picture MasterOfTheTiger  Â·  4Comments

vbauerster picture vbauerster  Â·  3Comments

alexherbo2 picture alexherbo2  Â·  4Comments

dpc picture dpc  Â·  4Comments