bronson / vim-visual-star-search

Start a * or # search from a visual block
http://got-ravings.blogspot.com/2008/07/vim-pr0n-visual-search-mappings.html
181 stars 36 forks source link

Visual star search replace #12

Open ghost opened 3 years ago

ghost commented 3 years ago

I request adding an option (if not already present) to use this plugin as normal, but hit ? or a similar key to start replacing text. For instance, say I have a file:

......occurrence...
....occurrence...

I would then select the first occurrence and hit * as usual, but press ? and type what to replace it with (then hit enter)

bronson commented 3 years ago

Yeah, this would be handy. I've always switched out of search mode and written a :substitution expression... and I've never questioned doing that until now.

I would expect the solution to apply to all star-searches, not just visual-star-searches. Heck, I'd expect it to work any time n and p take you to a new match, so all searches.

Have you looked for a plugin that can perform find-and-replace using vim's built-in searching (without resorting to writing ex :s// expressions)? If that plugin exists, I would expect it to work fine with visual-star-search.

If it doesn't exist, someone should write it. :)