Skip to content

Idiomatic way to search and replace similar to :%s/from/to/gc #5912

Answered by Brixy
getreu asked this question in Q&A
Discussion options

You must be logged in to vote

This is probably not possible with multiple cursors.

For such cases I do a simple search (/), replace the first match (c), go to the next match (n) and press . to repeat the replacement.

This is probably no more work than using Vim’s c flag because you have to confirm each replacement in both cases.

I am also curious if there are better methods ;-)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@getreu
Comment options

Comment options

You must be logged in to vote
1 reply
@getreu
Comment options

Answer selected by getreu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants