cat gen_cscope.sh
#!/bin/bash
sudo find /usr/include/ ~/dr_ws/ -name "*.h" -o -name "*.hh" -o -name "*.hpp" -o -name "*.c" -o -name "*.cpp" -o -name "*.cc" -o -name "*.cxx" > cscope.files
cscope -bkq -i cscope.files
use :
cd -
10038 sudo find /usr/include/ ~/dr_ws/ -name "*.h" -o -name "*.hh" -o -name "*.hpp" -o -name "*.c" -o -name "*.cpp" -o -name "*.cc" -o -name "*.cxx" > cscope.files
10039 cat cscope.files |grep .hh
10040 ls
10041 cscope -bkq -i cscope.files
10042 ll
10043 ll /usr/include/qhull/io.h
damn it ,in order to add cscope.out of system header, or some other cscope.out:
cd .vim/
9919 ls
9920 mkdir syscscope
9921 cd syscscope/
9922 sudo find /usr/include/ -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.cc" > cscope.files
9923 ls
9924 cat cscope.files
9925 cscope -bkq -i cscope.files
9926 ls
.vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" cscope setting
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("cscope")
set csprg=/usr/bin/cscope
set csto=1
"同时查找cscope数据库和tags文件
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
set csverb
endif
" else add database pointed to by environment
if $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
endif
"ctrl + _
nmap <Leader>-s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <Leader>-g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <Leader>-c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <Leader>-t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <Leader>-e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <Leader>-f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <Leader>-i :cs find i <C-R>=expand("<cfile>")<CR>$<CR>
nmap <Leader>-d :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap <Leader>-h :cs help <C-R>=expand("<cword>")<CR><CR>
.bashrc
export CSCOPE_DB=~/.vim/cscope/cscope.out
#export CSCOPE_DB=~/.vim/cscope/syscscope/cscope.out
#CSCOPE_DB=$CSCOPE_DB:~/.vim/cscope/dr_ws/cscope.out

1014

被折叠的 条评论
为什么被折叠?



