Thursday, May 15, 2008

vim - some tips on use cscope and ctags

1. cscope does not work very well on c++, it is hard to search class members. (so don't expect cscope can do everything)

2. don't use "cscope -b -q" to build the database

3. with ctrl-\ and f, open header file in a c/C++ source code

nmap < C-\>f :cs find f < C-R>=expand("< cword>") . ".h" < CR>< CR>

4. add database with specification on ignore charactor case.

cs add cscope.out . -C

5. Here is my build bat file for win32

rm cscope.* tags
set project=c:\work\foo
find %project% -name "*.cpp" -o -name "*.[ch]" > cscope.files
cscope -b
ctags --extra=+q -L cscope.files