How can I use ‘/’ within a pattern, without escaping it?

When using / to search for a pattern, you need to escape all ‘/’ within the pattern, because they would otherwise terminate the pattern. So you can’t directly search for /usr/share/doc/ but need to search for \/usr\/share\/doc\/ The easiest solution around that, would be to use ‘?’ to start a backward search and afterwards use /<CR> to use the last search-pattern in forward direction. If you have a Vim, that has the eval-feature built in (which needs at least a normal built or higher), you can also directly paste the pattern into the search register: :let @/ = ‘/usr/share/doc/’ Then use ‘n’ to jump to the next occurrence. See also the help at @/ /<CR>

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