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

Make pasting replace the entire selection #7768

Closed
wants to merge 1 commit into from

Conversation

Resonious
Copy link

Hey folks.

I don't think anyone asked for this, but it's an idea that would improve my productivity at least.

In vim, you can make a selection and then "p" to replace the selection with whatever you have yanked. I used to do this a ton in vim. It's one way to work around #3001.

This PR makes non-linewise selections replaced when pasting onto them.

Kooha-2023-07-28-16-29-38.webm

This is a breaking change so I don't really expect a merge as-is. Just wanted to bring up the idea and do some legwork as well. One alternative could be to implement this as a separate command and bind it to, say, a-p.

Anyway let me know what you think. If you have time.

This is a vim thing. If you have some text selected and you paste with
"p", the pasted contents *replaces* your selection. Before this commit,
Helix would append after your selection.
@gabydd
Copy link
Member

gabydd commented Jul 28, 2023

there are already separate commands for this: R and <space>R

Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have R for this and I don't see us changing the p command

@Resonious
Copy link
Author

Oh wow how embarrassing 😂. Carry on then!

@Resonious Resonious closed this Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants