Last Updated: February 25, 2016
·
666
· caioariede

Vim: Search and replace inside a visual selection

Select the block of code you want to search and replace then type:

:s/\%Vfoo/bar/g

For more information, type:

:help \%V