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

Replace should interrupt select mode #3460

Closed
IvanGoncharov opened this issue Aug 16, 2022 · 3 comments
Closed

Replace should interrupt select mode #3460

IvanGoncharov opened this issue Aug 16, 2022 · 3 comments
Labels
C-enhancement Category: Improvements

Comments

@IvanGoncharov
Copy link

IvanGoncharov commented Aug 16, 2022

Most of the time, I use select mode to do:

  1. yanking
  2. deleting
  3. replacing

Pressing y and d exit select mode but r/R doesn't.
This breaks the v<movement><operation> pattern, and my brain is confused by the fact that I am still in selection mode.

I've been using helix as my primary editor for a few days, and my brain switched already, except for this particular behavior that still surprises me every time.

Note: It makes sense to keep selection after R (to be consistent with y) just exiting v mode would solve it for me.

@IvanGoncharov IvanGoncharov added the C-enhancement Category: Improvements label Aug 16, 2022
@IvanGoncharov IvanGoncharov changed the title RFC: Replace should interrupt select mode Replace should interrupt select mode Aug 16, 2022
@the-mikedavis
Copy link
Member

I haven't noticed this behavior so I'm not sure where I stand. Delete always and yank usually comes at the end of a sequence but with replace you may want to then operate on the new text in the selection, so it may make sense to stay in select mode.

You use a binding like so in your config:

[keys.select]
r = ["replace", "normal_mode"]
R = ["replace_with_yanked", "normal_mode"]

@IvanGoncharov
Copy link
Author

You use a binding like so in your config:

@the-mikedavis Thanks a lot 👍
I also replaced it in a space mode:

[keys.normal.space]
R = ["replace_selections_with_clipboard", "normal_mode"]

The only problem beyond dependency on custom config is I'm losing the description of those commands:
image

Delete always and yank usually comes at the end of a sequence but with replace you may want to then operate on the new text in the selection, so it may make sense to stay in select mode.

Yes, it's an argument for keeping the selection, but it's hard to imagine a sequence where you replace a selection but need to select more.
In my workflow, I sometimes add text after a replacement, but I don't need to continue selection for that.

@xJonathanLEI
Copy link
Contributor

Should have been resolved by #4554?

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

3 participants