Skip to content

Instantly share code, notes, and snippets.

@conorliv
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conorliv/5f5cbdb9d0975bd7b166 to your computer and use it in GitHub Desktop.
Save conorliv/5f5cbdb9d0975bd7b166 to your computer and use it in GitHub Desktop.
cscope quickref
==========================================
Setup
==========================================
Install (OSX) brew install cscope
Setup cscope.files find /path/to/src -name '*.<file ext>' > /path/to/src/cscope.files
Create/recreate db cscope -b -q
==========================================
Using in Vim
==========================================
Add new cscope database connection :cs add {file|dir}
Find this C symbol :cs find {0|s} <symbol name>
Find this definition :cs find {1|g} <definition name>
Find functions called by this function :cs find {2|d} <function name>
Find functions calling this fuction :cs find {3|c} <function name>
Find this text string :cs find {4|t} <text>
Find this egrep pattern :cs find {6|e} <pattern>
Find this file :cs find {7|f} <filename>
Find files #including this file :cs find {8|i} <filename>
Help :cs help
Show cscope connections :cs show
Reinit all cscope connections :cs reset
Kill cscope connection :cs kill {number|partial_name}
Show documentation :help if_cscop.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment