Search code examples
keyboard-shortcutsvim

Searching for backslash character in vim


How to search word start \word in vim. I can do it using the find menu. Is there any other short cut for this?


Solution

  • Try /\\word in command mode.

    This works because, to escape a special character, we precede it with a backslash (\). Since \ is a special character (and one you want to actually search for), we escape it with backslash.

    Reference