Search for ~ (tilde) in vim

2.1k views Asked by At

How can I search for a ~ (tilde) in vim?

I tried /\~ and / \~ as /~ does not work.

Thanks for your help!

1

There are 1 answers

0
Kent On BEST ANSWER

/\~ works here. (with magic as default)

There are other ways,

  • you can search by character class: /[~]
  • you can search in nomagic mode /\M~
  • you can search in very nomagic mode /\V~