Melon
Melon

Reputation: 614

Cscope insensitive search

I am trying to do a case insentive search in vim with cscope. For example:

:cs find e regexp

Should find regexp, REGEXP, Regexp and so on... How can I do this? I've been trying the (?i) in front of the expression, but that didn't help.

Upvotes: 1

Views: 3911

Answers (2)

lubgr
lubgr

Reputation: 38287

For me, romainl's answer didn't work. Instead,

set csprg=cscope\ -C

did the job.

Upvotes: 1

romainl
romainl

Reputation: 196596

:cs find e expects an egrep pattern. Since egrep is not case-insensitive by default there's no reason to expect the pattern regexp to match regexp, REGEXP, etc.

Also, egrep doesn't honor (?i).

To make cscope's search (all search methods, not only egrep) case-insensitive by default, you must add the -C flag to your initialization command:

:cscope add cscope.out -C

Upvotes: 3

Related Questions