pepper icon indicating copy to clipboard operation
pepper copied to clipboard

Add align selections

Open NNBnh opened this issue 2 years ago • 2 comments

Align selections is a crucial and very frequently use action (example) that I really miss when switch to Pepper. From Kakoune's keys docs:

& : Align selections, align the cursor of each selection by inserting spaces before the first character of each selection.

NNBnh avatar May 01 '22 17:05 NNBnh

At first this seems like a complex feature. From looking at the example gif, it seems that it detects that there are two columns and align cursors accordingly. What happens if there's a different number of cursors on each line? Does it try to match the closest cursors along each column? Or does it simply match the nth cursor of each line? Or something different?

Also, this is certainly something that could be accomplished today by a code plugin.

vamolessa avatar May 03 '22 03:05 vamolessa

What happens if there's a different number of cursors on each line? Does it try to match the closest cursors along each column? Or does it simply match the nth cursor of each line? Or something different?

I have come back to Kakoune and play around a bit to confirm that: Yes "it simply match the nth cursor of each line"!

Before After
Before After

NNBnh avatar May 07 '22 15:05 NNBnh