From 2a713a6ab5140fab33e20afd208f62568785b543 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Mon, 26 Oct 2020 11:26:46 -0500 Subject: General updates --- .vim/cscope.vim | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .vim/cscope.vim (limited to '.vim') diff --git a/.vim/cscope.vim b/.vim/cscope.vim new file mode 100644 index 0000000..53e4dd9 --- /dev/null +++ b/.vim/cscope.vim @@ -0,0 +1,53 @@ +if has("cscope") + set cscopetag + set csto=0 + if $CSCOPE_DB != "" + cs add $CSCOPE_DB + else + let dirs = split($PWD, '/') + let paths = ['/'] + for d in dirs + let paths = add(paths, paths[len(paths) - 1] . d . '/') + endfor + + for d in reverse(paths) + let cscope_file = d . "/cscope.out" + if filereadable(cscope_file) + execute('cs add ' . cscope_file) + break + endif + endfor + endif + + set cscopeverbose + + 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("") + nmap S :cs find t struct =expand("") { + + nmap s :vert scs find s =expand("") + nmap g :vert scs find g =expand("") + nmap c :vert scs find c =expand("") + nmap t :vert scs find t =expand("") + nmap e :vert scs find e =expand("") + nmap f :vert scs find f =expand("") + nmap i :vert scs find i ^=expand("")$ + nmap d :vert scs find d =expand("") + nmap S :vert scs find t struct =expand("") { + + nmap s :scs find s =expand("") + nmap g :scs find g =expand("") + nmap c :scs find c =expand("") + nmap t :scs find t =expand("") + nmap e :scs find e =expand("") + nmap f :scs find f =expand("") + nmap i :scs find i ^=expand("")$ + nmap d :scs find d =expand("") + nmap S :scs find t struct =expand("") { +endif -- cgit v1.2.3