0

How do I search and replace in a visual block only?

'<,'>s/search/replace/ works on entire lines, not visual blocks only.

1

You can use the \%V (:h \%V) to do that:

:%s/\%Vsearch/replace/
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.