Search This Blog

Friday, April 12, 2013

How to use cscope and ctags

(suppose cscope, ctags and vim are all installed
check:
which cscope)

First, generate database files:

1.
find . -name "*.h" -o -name "*.c"  > cscope.files
cscope -bkq -i cscope.files
2.
ctags -R *

Second, modify ~/.vimrc

add:

set tags=tags;                              (maybe need to explicity point out the path)
set autochdir

Third,

in vim, run:
 : cscope add cscope.out