我最近才刚用回cscope,很早用ctags就是碰到你说的这个问题,然后就弃了,汗。
你这个是合理的。不过我也刚好查了 向上搜寻"cscope.out"的方法,就顺便放在这里,给需要的人取用:
" add any cscope database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add the database pointed to by environment variable
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
else
let cscope_file=findfile("cscope.out", ",;")
let cscope_pre=matchstr(cscope_file, ".*/")
if !empty(cscope_file) && filereadable(cscope_file)
exe "cs add" cscope_file cscope_pre
endif
endif
【 在 cn62 的大作中提到: 】
: 还是别想着指定makefile位置了,不管怎么指定都得晕。
: 我的做法是,命令行只进到项目根目录,不进子目录,vim编辑文件的时候指定子目录。
: 这样还有个好处,你是用全局的视角看整个项目,而不是钻进项目里在各个子目录跳来跳去。
: ...................
--
FROM 14.26.9.*