vim: replace a string with the "/" character in it -
i've been using following replace characters:
to find each occurrence of
eth0in current line only, , replacebr0,enter (first press esc key , type)::s/eth0/br0/gto find , replace occurrences of
eth1br1, enter::%s/eth1/br1/gto find , replace occurrences of
eth1br1, ask confirmation first, enter::%s/eth1/br1/gcto find , replace occurrences of case insensitive
eth1br1, enter::%s/eth1/br1/gi
however, how replace string 1 has / in it. example, want replace debug printf statements //. when type..
:%s/printf/ // /gc it gives me trailing characters error. if teach me how thankful.
thank you!
you can use different separator:
:s+sprintf+ // +g
Comments
Post a Comment