if has("cscope")
set csprg=~/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
endif
function s:FindFile(file)
let curdir = getcwd()
let found = curdir
while !filereadable(a:file) && found != "/"
cd ..
let found = getcwd()
endwhile
execute "cd " . curdir
return found
endfunction
if has('cscope')
let $CSCOPE_DIR=s:FindFile("cscope.out")
let $CSCOPE_DB=$CSCOPE_DIR."/cscope.out"
if filereadable($CSCOPE_DB)
cscope add $CSCOPE_DB $CSCOPE_DIR
endif
command -nargs=0 Cscope !cscope -ub -R &
endif