From a9dd4863607e2ab0c2494426026a60cc40da99da Mon Sep 17 00:00:00 2001 From: qhuang Date: Tue, 7 May 2013 19:42:53 +0800 Subject: [PATCH] add ctags and cscope config --- .gitignore | 1 + my_configs.vim | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/.gitignore b/.gitignore index 5fb7daf6..2e565867 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ sources_non_forked/ack.vim/.netrwhist temp_dirs/yankring_history_v2.txt sources_forked/yankring/doc/tags sources_non_forked/tlib/doc/tags +systags diff --git a/my_configs.vim b/my_configs.vim index 1fa3a85b..d26af48e 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -5,3 +5,43 @@ set nu " the color I used to colorscheme desert + +"""""""""""""""""""""""" +" [my plugin setup] +" +" ctags +set tags=tags; +set tags+=~/.vim/systags +set autochdir + +" cscope +if has("cscope") + set csprg=/usr/bin/cscope + set csto=1 + set cst + if filereadable("cscope.out") + cs add cscope.out . + elseif filereadable("../cscope.out") + cs add ../cscope.out .. + elseif filereadable("../../cscope.out") + cs add ../../cscope.out ../.. + elseif filereadable("../../../cscope.out") + cs add ../../../cscope.out ../../.. + elseif filereadable("../../../../cscope.out") + cs add ../../../../cscope.out ../../../.. + elseif filereadable("../../../../../cscope.out") + cs add ../../../../../cscope.out ../../../../.. + elseif filereadable("../../../../../../cscope.out") + cs add ../../../../../../cscope.out ../../../../../.. + endif + set csverb +endif + +nmap s :cs find s =expand("") +nmap g :cs find g =expand("") +nmap c :cs find c =expand("") +nmap t :cs find t =expand("") +nmap e :cs find e =expand("") +nmap f :cs find f =expand("") +nmap i :cs find i ^=expand("")$ +nmap d :cs find d =expand("")