vim how to search for URL

后端 未结 5 943
借酒劲吻你
借酒劲吻你 2021-01-12 15:12

How would you search for the following string in vim?

http://my.url.com/a/b/c

I\'ve tried (a la Very No Magic)

:/\\Vhttp://         


        
5条回答
  •  感动是毒
    2021-01-12 15:40

    another way to search forward (from the position of your cursor) without escaping is use :s command.

    you could do:

    :%s@http://my.url.com/a/b/c@@n
    

    then press n to navigate matched text forward, N backwards

    If you want to know how many matches in the buffer, use gn instead of n

    note that, I said "without escaping", I was talking about the slash, if you want to do search precisely, you have to escape the period. .. since in regex, . means any char.

提交回复
热议问题