vim cannot connect to cscope database

Aijaz Baig picture Aijaz Baig · Jun 23, 2011 · Viewed 28.2k times · Source

I have opensuse 11.4 installed. Vim is version 7. Now I normally use it to browse the linux kernel source. So I generated the cscope database inside a directory within my home folder i.e. /home/aijazbaig1/cscope_DB/ and I got 3 files viz. cscope.out, cscope.po.out and cscope.in.out besides the cscope.files file which contains a list of all the relevant files which I want to search.

Additionally I have added the following to my .bashrc:

CSCOPE_DB=/home/aijazbaig1/cscope_DB/cscope.out
export CSCOPE_DB

But when I do a :cscope show from within vim it says there are no connections. Can anyone please let me know what is going wrong.

Keen to hear from you,

Answer

Wesley Bland picture Wesley Bland · Apr 8, 2015

This is mentioned in the comments above, but I want to make sure it's preserved in an answer.

The issue that came up for me was that vim didn't know where to look for the cscope database. When I added

cs add $CSCOPE_DB

to my .vimrc. Everything came out fine.