diff options
Diffstat (limited to '.vim/after/plugin/cscope.vim')
-rw-r--r-- | .vim/after/plugin/cscope.vim | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/.vim/after/plugin/cscope.vim b/.vim/after/plugin/cscope.vim index b0c9392..a098e18 100644 --- a/.vim/after/plugin/cscope.vim +++ b/.vim/after/plugin/cscope.vim @@ -1,14 +1,26 @@ -set cscopequickfix=s-,c-,d-,i-,t-,e- +if executable('gtags-cscope') + let &csprg='gtags-cscope' +endif + +set cscopequickfix=g-,s-,c-,d-,i-,t-,e- set cscopetag +set cscoperelative nmap <leader>css :cs find s <C-R>=expand("<cword>")<CR><CR> -nmap <leader>csg :cs find g <C-R>=expand("<cword>")<CR><CR> -nmap <leader>csc :cs find c <C-R>=expand("<cword>")<CR><CR> +nmap <leader>csg :cs find g <C-R>=expand("<cword>")<CR> +nmap <leader>csc :cs find c <C-R>=expand("<cword>")<CR> nmap <leader>cst :cs find t <C-R>=expand("<cword>")<CR><CR> nmap <leader>cse :cs find e <C-R>=expand("<cword>")<CR><CR> nmap <leader>csf :cs find f <C-R>=expand("<cfile>")<CR><CR> nmap <leader>csi :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR> -nmap <leader>csd :cs find d <C-R>=expand("<cword>")<CR><CR> -nmap <leader>csa :cs find a <C-R>=expand("<cword>")<CR><CR> +nmap <leader>csd :cs find d <C-R>=expand("<cword>")<CR> +nmap <leader>csa :cs find a <C-R>=expand("<cword>")<CR> nmap <leader>cs<space> :cs find<space> + +if has('cscope') + let tagfile = findfile("GTAGS", ".;") + if filereadable(tagfile) + exec "cs add" tagfile + endif +endif |