How do I select multiple lines going upwards on Kakoune?

Viewed 2389

In Vim I would enter visual mode with V then just move the cursor up (with k).

In kak I can select a line with x and I can extend the selection downwards by pressing X multiple times or by moving the cursor down while still pressing shift with J, but if I go up while still pressing shift, with K I keep the selection, but not for the entire line, the selection on the first selected line somehow jumps to column 0.

2 Answers

That's because Kakoune's selections are oriented. When you select a line with x, the cursor is at the end of the line and the anchor at the beginning. shiftk means "extend the selection to the character above", but extend mean "select to there while keeping the same anchor" and the "character above" is the last character of the previous line.

In short, you need to switch the direction of the selection before extending up: x + alt; + shiftk.

Related