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

Keybind to add cursors on both ends of a selection #2413

Closed
ghost opened this issue May 5, 2022 · 6 comments
Closed

Keybind to add cursors on both ends of a selection #2413

ghost opened this issue May 5, 2022 · 6 comments
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@ghost
Copy link

ghost commented May 5, 2022

It would be nice to have a feature of "surrounding cursors".

Kind of like a fusion of ms (surround add) and C (spawn cursor below).

I think this would also fit Helix's overall philosophy of embracing multiple cursors.

@ghost ghost added the C-enhancement Category: Improvements label May 5, 2022
@EpocSquadron
Copy link
Contributor

Can you be a little more specific? Are you looking to select only the surrounding braces but nothing between? This is the default behavior in normal mode if you use mm with the cursor on one of the braces, but I could see cases where you would want to select only braces while the current selection is between them.

@ghost
Copy link
Author

ghost commented May 6, 2022

Well, mm goes to the matching delimiter. What I would like to do is:

  • select a passage of text using x or v (let's say the selection is "lorem ipsum")
  • press <new keybinding>
  • now I have two cursors before and after the selection: "<CURSOR>lorem ipsum<CURSOR>"

This would basically allow more involved surrounded editing than the m commands alone are currently able to.

@sudormrfbin sudormrfbin changed the title Surrounding cursors Keybind to add cursors on both ends of a selection May 6, 2022
@sudormrfbin
Copy link
Member

I've changed the title to be a bit more descriptive, hopefully still describing what you meant.

@ghost
Copy link
Author

ghost commented May 6, 2022

@sudormrfbin yes, thanks :)

@stonewareslord
Copy link
Contributor

Would this type of implementation work for you? I have been working on Kakoune's (<a-S>)[https://github.com/mawww/kakoune/blob/master/doc/pages/keys.asciidoc] keybinding

Orig:
image

After <A-S>:
image

Then you could grab your whole object with ma( and select the () with <A-S>

Code: https://github.com/helix-editor/helix/compare/master...stonewareslord:feature/select-head-and-anchor?expand=1

@kirawi
Copy link
Member

kirawi commented Apr 15, 2024

Rejected in #9459

@kirawi kirawi closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

5 participants