I use Vim to read man pages. But I'm having trouble searching for variables. For example I use:
/\<-s\>
to search for '-s', but it doesn't find anything. Grrr. I see it in the file. What am I doing wrong?
I use Vim to read man pages. But I'm having trouble searching for variables. For example I use:
/\<-s\>
to search for '-s', but it doesn't find anything. Grrr. I see it in the file. What am I doing wrong?
\<
matches the beginning of a word, and -
normally isn't considered a word character. Do :set iskeyword?
to see what characters are considered word characters.
Try this:
:set iskeyword+=-
/\<-s\>
Should work then. See :h /\<
and :h 'iskeyword'
.