Find And Replace In Selection In Vim

Posted by Weston Ganger

I was wanting to find and replace in my selection when using VIM but my usual methods were changing on the entire line even if I only selected a small portion of a line

This method will only do the selection area, not the entire line(s).


# replace 'original' with 'replacement'
:%s/\%Voriginal/replacement/g


Related External Links:

Article Topic:Software Development - Linux

Date:May 21, 2015

Recommended Posts