从打开文件的当前目录向上寻找路径上所有的cscope.out添加到cscope connection
if has("cscope")
set csprg=/usr/bin/cscope"output cscope to quickfix
set cscopequickfix=s-,c-,d-,i-,t-,e-
set csto=0
set cst
" display the entire path
set cspc=0
set nocsverb
let path_element=split(substitute(getcwd(), '/', " ", "g"))
let path="/"
let path_list=[]
let file_list=[]
for i in range(0,len(path_element)-1)
let path=path.get(path_element,i)."/"
call add(file_list,path."cscope.out")
call add(path_list,path)
endfor
for i in range(len(file_list)-1,1,-1)
if filereadable(get(file_list,i))
execute "cs add ".get(file_list,i)." ".get(path_list,i)
endif
endfor
set csverb
endif