-2

In unix, while using VIM and the substitue command I am unable to replace the value to a string containing special character /

 :%s/var1/"ab1/ab2/ab3"/g

I need to replace the entire file containing var1 with ab1/ab2/ab3

Output in vim I see: Trailing characters

romainl
  • 186,200
  • 21
  • 280
  • 313
melony_r
  • 177
  • 1
  • 1
  • 8

1 Answers1

0

Escape both / like so \/.....

Bib
  • 922
  • 1
  • 5
  • 10