I always use vim + cscope to check symbol definition, and I find cscope always take declaration like:
struct sk_buff;
as a definition, which make vim always show a long list files to choose. Indeed, I only want the definition:
struct sk_buff {
...
};
Seems ctags can resolve this problem, but can cscope handle this? Or somethings I'm wrong.
I checked the cscope source, and I find it's hard to modify the lex and yacc source from beginning.
To exit from cscope interactive prompt, type Ctrl-d . If you just want to rebuild cscope's database, and not invoke cscope's interactive prompt, pass it the -b option.
cscope, ctags, and Vim are powerful tools for reading a lot of code. ctags can be used to take you to the definition of a variable (e.g., a function, variable, or macro). cscope can be used to take you to the call site of a definition (e.g., all function calls, all variable uses, all macro uses).
You are correct, you cannot do this just with cscope.
I use cscope+ctags with vim every day on both small and large projects as well.
I've found the most productive way to use these tools is to use them both from within vim and with the cscope_maps.vim plugin.
This may not help you but it's helped me int he past, check this site for information on using them together. I'll warn you that if you use the cscope_maps.vim plugin you'll probably want to edit it and comment out the "set cscopetag" option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With