vim – /in vi搜索和替换?

在vi中,搜索和替换,如何转义一个’/'(正斜杠),使它是正确的。在路径中说。

像:/ Users / tom / documents / pdfs /

:%s//Users/tom/documents/pdfs//<new text>/g  --FAILS (obvIoUsly)

:%s/\/Users/tom/documents/pdfs\//<new text>/g -- FAILS with a trailing error

:%s/'/Users/tom/documents/pdfs/'/<new text>/g -- FAILS with a trailing error

我缺少什么?

你还需要在内部避开前斜线。
:%s/\/Users\/tom\/documents\/pdfs\//<new text>/g

相关文章

解决方案:解决linux下vim乱码的情况:(修改vimrc的内容)全...
Linuxvi/vim所有的UnixLike系统都会内建vi文书编辑器,其他的...
      vim正则匹配:空行:/^$/  /^[\t]*$/注释...
$select-editorSelectaneditor.Tochangelater,run'sele...
上次手贱忘了保存,这次就简单做个备忘吧,把踩过的坑记一下...
Linux之文本编译器小结vim的优势所有的UNIX-LIKE习通都会内置...