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

range for visual selection #16115

Closed
stumash opened this issue Oct 21, 2021 · 5 comments
Closed

range for visual selection #16115

stumash opened this issue Oct 21, 2021 · 5 comments
Labels
closed:duplicate issues that are closed as duplicates of other issues enhancement feature request

Comments

@stumash
Copy link

stumash commented Oct 21, 2021

Feature already in Vim?

no

Feature description

let's say I have a text file

here's a line of text.
then another.
and finally a third line.

let's say I go to visual mode and select some text (selection indicated by upper case letters)

here's a line OF TEXT.
THEN ANOther.
and finally a third line.

while the text is visually selected, when I hit : I go to command mode with a line range

:'<,'>

and let's say I end up doing

:'<,'>s/t/ZZ/g

that would leave the file like this

here's a line of ZZexZZ.
ZZhen anoZZher.
and finally a third line.

THE PROBLEM IS: I didn't select the whole first two lines, I only selected of text.\nthen ano

I don't want every single t in the lines that include my visual selection to be replaced, I only want the ts that are within the selection itself to be replaced. That last ZZ shouldn't have happened becase that t was outside my selection.

Is there anyway to do this?
Can we add a syntax (I propose :`<,`>) for when we want comands to operate only the selection itself, not all the lines that contain it.

@stumash stumash added the enhancement feature request label Oct 21, 2021
@gpanders
Copy link
Member

@stumash
Copy link
Author

stumash commented Oct 21, 2021

I'm not sure I understand the status of this feature request based on the issues you linked to.

is vim/vim#3292 still TODO? can we not just beat them to it here in neovim?

@gpanders
Copy link
Member

can we not just beat them to it here in neovim?

Sure, PRs welcome. Or even better, send one to Vim and we can port it here so everyone benefits.

@stumash
Copy link
Author

stumash commented Oct 21, 2021

sounds easy enough 😛 jk no it doesn't

@616b2f
Copy link
Sponsor

616b2f commented Jul 31, 2023

can we close this as duplicate of #22297

@justinmk justinmk added the closed:duplicate issues that are closed as duplicates of other issues label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:duplicate issues that are closed as duplicates of other issues enhancement feature request
Projects
None yet
Development

No branches or pull requests

4 participants