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

Contact

604-309-8713
info@solidfoundationwebdev.com

Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected