标签:
Cscope是类似于ctags一样的工具,但可认为他是ctags的增强版。
1 "......................................cscope........................... 2 if has("cscope") 3 set csprg=/usr/bin/cscope 4 set csto=0 5 set cst 6 set nocsverb 7 " add any database in current directory 8 if filereadable("cscope.out") 9 cs add cscope.out 10 " else add database pointed to by environment 11 elseif $CSCOPE_DB!="" 12 cs add $CSCOPE_DB 13 endif 14 set csverb 15 endif 16 "....................................cscope replace 17 nmap <C-@>s :cs find s <C-R>=expand("<cword>")<CR><CR> 18 nmap <C-@>g :cs find g <C-R>=expand("<cword>")<CR><CR> 19 nmap <C-@>c :cs find c <C-R>=expand("<cword>")<CR><CR> 20 nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR> 21 nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR> 22 nmap <C-@>f :cs find f <C-R>=expand("<cfile>")<CR><CR> 23 nmap <C-@>i :cs find i <C-R>=expand("<cfile>")<CR><CR> 24 nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>
使用方法是,同时按下Ctrl+@后松开按下‘s‘:
需要注意的一点是:打开源文件需要在cscope.out路径下打开,如$ vi ./drivers/tty/serial/imx.c而不是到serial目录下执行$ vi imx.c.否则会出现找不到cscope.
标签:
原文地址:http://www.cnblogs.com/aaronLinux/p/5469158.html