Cscope is a Linux software, its function is mainly used in reading code, called Windows under the source Insight, but with the use of vim, the efficiency is unparalleled. For specific use, install Vim first, then perform the VIM command at the terminal and execute it at the command line: Help CS. The following configurations are available for testing. The following are the configurations in ~/.VIMRC.
Set Nuset shiftwidth=4Set TabStop=4Set Softtabstop=4Set Autoindentnmap<f2>s:cs Find S <c-r>=expand ("<cword>") <CR><CR>Nmap<f2>g:cs Find G <c-r>=expand ("<cword>") <CR><CR>Nmap<f2>d:cs Find D <c-r>=expand ("<cword>") <CR><CR>Nmap<f2>c:cs Find C <c-r>=expand ("<cword>") <CR><CR>Nmap<f2>t:cs Find T <c-r>=expand ("<cword>") <CR><CR>Nmap<f2>e:cs Find e <c-r>=expand ("<cword>") <CR><CR>Nmap<f2>f:cs Find F <c-r>=expand ("<cword>") <CR><CR>Nmap<f2>i:cs Find I <c-r>=expand ("<cword>") <CR><CR>ColorScheme DesertifHas ("Cscope") Set CSPRG=/usr/local/bin/Cscope Set Csto=0 Set CST set nocsverb set Cscopequickfix=s-,c-,d-,i-,t-,e-"Add any database in current directory ifFilereadable ("Cscope.out") CS Add cscope.out"Else Add database pointed to by environmentElseIf $CSCOPE _db! =""CS Add $CSCOPE _db endif set Csverbendif
With the above configuration, the following methods are used:
F2 + S Find this C symbol
F2 + G Find this definition
F2 + D Find functions called by this function
F2 + C Find functions Calling this function
F2 + t Find This text string
F2 + e Find this egrep pattern
F2 + F Find This file
F2 + i Find Files #including This file
Let the code fly up on the keyboard!
end!
"Linux"--cscope