PracticalVim Tip78 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 78: Escape Problem Characters

Return to the top: <>

Escape / Characters When Searching Forward

Example:

  • yank the URL into register u with the command `"uyi[`
  • ]`/\Vu` to populate the search field with the contents of that same register.

Vim interpreted the first `/` character as a search field terminator.

Escape ? Characters When Searching Backward

Example:

Escape \ Characters Every Time

Example:

Escape Characters Programmatically

References:

Example:

  • Store the URL in the u register:
  • Enter the \V literal switch and then type =.

References:

Search Field Terminators

`:promptfind` command: entering a pattern without having to worry about search field terminators (works only in GVim)

References:

⚠️ **GitHub.com Fallback** ⚠️