1) Reference:
2) cscope help:
:help cscope
:help cscope-suggestions
:cs help
3) Generate index files:
find fullpath/of/your/project –type f > cscope.files
cscope -bq
4) cscope command:
add : Add a new database (Usage: add file|dir [pre-path] [flags])
find : Query for a pattern (Usage: find c|d|e|f|g|i|s|t name)
c: Find functions calling this function
d: Find functions called by this function
e: Find this egrep pattern
f: Find this file
g: Find this definition
i: Find files #including this file
s: Find this C symbol
t: Find assignments to
5) Add cscope setting in .vimrc:
if has("cscope") set csprg=/usr/local/bin/cscope set csto=0 set cst set nocsverb " add any database in current directory if filereadable("cscope.out") cs add cscope.out " else add database pointed to by environment elseif $CSCOPE_DB != "" cs add $CSCOPE_DB endif set csverb endifnmaps :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(" ") " Using 'CTRL-spacebar' then a search type makes the vim window " split horizontally, with search result displayed in " the new window.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(" ") " Hitting CTRL-space *twice* before the search type does a vertical " split instead of a horizontal onenmap 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 i \:vert scs find i ^ =expand(" ") $ nmap d \:vert scs find d =expand(" ")