cscope cannot use in vim

388 views Asked by At

I cannot use cscope in vim. The commands below are not work

:cs find s {name}
:cs find c {name}
...

The error code is about "E259 No matches found..." but I add and execute the database exactly.

I use :cs show to show the database I use, and there is nothing wrong.

Here are the command I build:

find "$(pwd -P)" -name "*.c" -o -name "*.h" > cscope.files
cscope -Rbqk -i cscope.files

and I set the :cs add /path/to/database/cscope.out in .vimrc

By build and add database with absolute paths, I think I can get the database in every c files in any subfolders.

The weird thing is, I can use cscope and find the symbol by:

cscope -Rqk -i cscope.files

I think something wrong about my vim but I don't know how to figure out.

Please, I need some helps.

1

There are 1 answers

0
Luis Colorado On

You should consult cscope-intro help tag:

:help cscope-intro

(in the vim screen)

to get the full help to the interace of vim to cscope. It requires to build the database to use from your source files first, so probably the used database is empty and that's the reason you don't find anything.

Vim's cscope commands are an interface (as it is told in the help page I recommended you to use) to the cscope shell command, so the most probable cause that it doesn't work is that you have not established a database to consult when using it.