Cscope-general Linux technology-Linux programming and kernel information. For more information, see the following. In vim, Cscope is used to quickly locate the function definition and find the function prototype, which is very convenient.
On my Fedora8 machine, cssag is installed by default.
I am not very familiar with cssag. Many "advanced" functions will be available for further exploration. Here we will first write down the simple use of csflood in vim so that it can be in the source code:
1. quickly switch to the function definition.
2. function declaration.
3. query the usage of a function.
First, let vim support csflood ~ /. Add the following to vimrc:
"Set cscopequickfix = s-, c-, d-, I-, t-, e -"
Second, it is necessary to generate the cscope information in the source code directory.
The libpcap code is used as an example.
# Cd/usr/code/libpcap
# Cs1_rbq
# Import the generated cscope file to vim
#: Cs add/usr/code/libpcap/cscope. out/usr/code/libpcap/
Next we can perform the actual drill operation in vim.
1. move the cursor to a function. use Ctrl +] to jump to the function definition.
2. Find the Declaration and definition of a function:
: Cs find g strcpy
3. If multiple function declarations and definitions are found, you can use the quickFix window to switch between them:
: Cw
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service