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?
+1
A:
Use a backslash.
:/\/
This will search forward to the next forward slash.
A. Levy
2009-09-09 09:35:54
The : is not necessary.
2009-09-09 09:36:44
Ah...yes you are right. But it doesn't hurt either. Thanks for the tip though!
A. Levy
2009-09-09 09:43:21
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
2009-09-09 10:01:56