pannayar wrote:
To search the string say /a/b/c/d/e/f/g/h/i in a file, is there a way to do
it without going to each / and escaping it to \/

I select and paste the string with my mouse, so it is a real pain to then go
and escape each forward /

:let @/ = escape('string with /slashes/, \backslashes\, .periods., *asterisks* etc.', '/\.*')

        n

Use single quotes to use the string literally. If there are single quotes in the string you will still have to double them.

The ":let" command above sets the search pattern but doesn't move the cursor. Then n finds the string in the direction / or ? of the latest search, N finds it in the opposite direction.


Best regards,
Tony.

Reply via email to