vim: replace a string with the "/" character in it -
i've been using following replace characters:
to find each occurrence of
eth0
in current line only, , replacebr0
,enter (first press esc key , type)::s/eth0/br0/g
to find , replace occurrences of
eth1
br1
, enter::%s/eth1/br1/g
to find , replace occurrences of
eth1
br1
, ask confirmation first, enter::%s/eth1/br1/gc
to find , replace occurrences of case insensitive
eth1
br1
, 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