Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending selections using the jumplist #12125

Closed
kaos opened this issue Nov 25, 2024 · 2 comments
Closed

Extending selections using the jumplist #12125

kaos opened this issue Nov 25, 2024 · 2 comments
Labels
C-enhancement Category: Improvements

Comments

@kaos
Copy link

kaos commented Nov 25, 2024

Helix have a dedicated (minor) mode for extending the selection(s), the selection mode, which turns regular movements and gotos to not only reposition the cursor, but also extend the selection to this new position.

However, jumping is currently not covered as valid repositioning for extending the selection which I think would be useful to have. (As long as the jump is buffer local, i.e. does not jump to a different buffer.)

In order to work effectively with the selection, having more options on how to manage it would be preferable.

I first started to look into this when I couldn't use v/ in order to extend my selection, as that is used to add search hits to the selection (with another cursor) rather than extending the current selection.

To solve this, I tried c-s to save my current position to the jumplist. Then after searching, vc-o to enter selection mode and jumping out to my saved position in the jumplist. Alas, jumps don't extend the selection. (yet?)

This is my primary motivating use case, but I'm sure there a numerous other ways to jump, that could also benefit from being used to extend the selection rather than only moving the cursor. (but only when performed in the selection mode.)

N.b. vgw?? (where ?? is a two-letter label presented in-buffer after hitting gw) allows you to go to any labeled point on the current page, which is easily overlooked and quite powerful, but is limited to what is currently in view.

@kaos kaos added the C-enhancement Category: Improvements label Nov 25, 2024
@kaos
Copy link
Author

kaos commented Nov 25, 2024

(Semi-)Related issues..

There are quite a few open issues relating to the topic of repositioning and selection (a subset of issues):

This #165 (comment) highlights the design intent with the selection mode pretty well.

Given the above, I actually find it inconsistent that w, e, and b (and their upper case counterparts) extends the selection in normal mode and not just repositions the cursor.
EDIT: Actually no, I was wrong here. The movements selects the "unit of movement". It doesn't extend the selection, as when you move on to the next word, the previous word is no longer selected. This is consistent with hjkl movement as well, as you always have a selection of 1 moving around.

@the-mikedavis
Copy link
Member

This is the use-case for marks #703, closing in favor of that. With marks you can save a selection to a register and then join it to your current selection.

@the-mikedavis the-mikedavis closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

2 participants