/ in vi Search and replace?

前端 未结 6 557
耶瑟儿~
耶瑟儿~ 2021-01-30 08:02

in vi, search and replace, how do you escape a \'/\' (forward slash) so that it is correct. Say in a path.

like: /Users/tom/documents/pdfs/

:%s//Users/to         


        
6条回答
  •  深忆病人
    2021-01-30 09:00

    Alternatively you can do :%s,foo/bar/baz,foo/bar/boz,g - I almost never use slashes because of the escaping confusion.

提交回复
热议问题