vim: replace a string with the "/" character in it -


i've been using following replace characters:

  1. to find each occurrence of eth0 in current line only, , replace br0,enter (first press esc key , type):

    :s/eth0/br0/g 
  2. to find , replace occurrences of eth1 br1, enter:

    :%s/eth1/br1/g 
  3. to find , replace occurrences of eth1 br1, ask confirmation first, enter:

    :%s/eth1/br1/gc 
  4. 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

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -