if has("cscope") " Look for a 'cscope.out' file starting from the current directory, " going up to the root directory. if (filereadable("cscope.out")) execute "cs add cscope.out" else let s:dirs = split(getcwd(), "/") while s:dirs != [] let s:path = "/" . join(s:dirs, "/") if (filereadable(s:path . "/cscope.out")) execute "cs add " . s:path . "/cscope.out " . s:path break endif let s:dirs = s:dirs[:-2] endwhile endif set csto=0 set cst set csverb 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("") map :copen map :cprevious map :cnext " Open a quicfix window for the following queries. set cscopequickfix=s-,c-,d-,i-,t-,e-,g- endif