views:

237

answers:

3

When I try to search a string starting with the slash / character in vi, the cursor jumps to the next search result from the previous search. However, I'd like to find the literal slash character. How can this be done?

+6  A: 

Type this:

/\/
+1  A: 

Use a backslash.

:/\/

This will search forward to the next forward slash.

A. Levy
The : is not necessary.
Ah...yes you are right. But it doesn't hurt either. Thanks for the tip though!
A. Levy
A: 

--- oops, sorry, I entered info for replace. Escaping with \ is better for search only

Use a different separator

:%s./.z.

will replace all '/' with the letter z

KevinDTimm