我想要在项目的子目录中自动加载 cscope.out
,所以我在我的 .vimrc
中添加了以下脚本:
set cscopequickfix=s-,c-,d-,i-,t-,e-
if has("cscope")
set csprg=/usr/bin/cscope
set csto=1
set cst
set csverb
set cspc=3
"add any database in current dir
if filereadable("cscope.out")
cs add cscope.out
"else search cscope.out elsewhere
else
let cscope_file=findfile("cscope.out", ".;")
"echo cscope_file
if !empty(cscope_file) && filereadable(cscope_file)
exe "cs add" cscope_file
endif
endif
endif
一开始它是可以工作的。但每次我尝试做以下操作时:
:cs find c [tag]
搜索结果将会出现在“QuickFix List”中,但是包含结果的文件无法打开。
如有建议,请不吝赐教。