How do I clear the last searched pattern?

The last searched pattern is stored in the “/” register. You can clear this register using the following command:

    :let @/=""

To clear the last search pattern whenever a buffer is unloaded, you can use the following command:

    :autocmd BufUnload * let @/ = ""

Read free Software Algorithms and Computer Science Books by CodeAhoy Learn.

Introduction to Recursion and Backtracking

Sorting Algorithms

Introduction to C Programming Language

And More...

Speak Your Mind