aboutsummaryrefslogtreecommitdiff
path: root/.vim/after/plugin/cscope.vim
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2023-11-17 00:40:12 +0800
committerGuangxiong Lin <[email protected]>2023-11-17 00:40:12 +0800
commit49b33aeaede7e77b084696cbc286b69260845542 (patch)
treefc66aea0cca67281815ed9cce97c74a2e9810dec /.vim/after/plugin/cscope.vim
parent39c8b27c342442e585e0729982bdb82a95bc2e6c (diff)
downloaddotfiles-49b33aeaede7e77b084696cbc286b69260845542.tar.gz
dotfiles-49b33aeaede7e77b084696cbc286b69260845542.tar.bz2
dotfiles-49b33aeaede7e77b084696cbc286b69260845542.zip
Update config on ruby and tags
Diffstat (limited to '.vim/after/plugin/cscope.vim')
-rw-r--r--.vim/after/plugin/cscope.vim22
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