你会如何在vim中搜索以下字符串?
http://my.url.com/a/b/c
Run Code Online (Sandbox Code Playgroud)
我试过了(非常没有魔法)
:/\Vhttp://my.url.com/a/b/c
Run Code Online (Sandbox Code Playgroud)
但它给了我:
E492 not an editor command: /\Vhttp://my.url.com/a/b/c
您会认为有一种简单的方法可以直接搜索字符串...我对斜线转义每个斜杠或编写复杂的搜索都不太感兴趣,因为我必须快速搜索文本文件中的不同URL.
因为我没有,所以我不确定你为什么not an editor command会这样做.最简单的搜索方式是使用?而不是逃避斜杠,例如
:?http://my.url.com/a/b/c
" or since the : is not necessary
?http://my.url.com/a/b/c
Run Code Online (Sandbox Code Playgroud)
这确实在另一个方向搜索,所以请记住这一点