Search code examples
vim

Search in gvim ignoring special characters


How do I search for a string in gvim ignoring all special/regex characters in it ?

Something like:

/<It doesn't matter what is here>


Solution

  • You can start your search string with \V to turn off regex searching:

    /\V<It doesn't matter what is here>
    

    This is very nomagic mode (the opposite of very magic mode). See :h \V.

    Just note that you still need to escape \ with \\.