Tony Mechelynck skribis: > I tried to understand how to use cscope (with the Vim source as a set of > sources to apply it to). Bram, correct me if I'm wrong. > > The following assumes $VIMSRC has been set (e.g. in the vimrc) to the > top-level directory of the Vim source & runtime distribution (on my > system, currently ~/.build/vim/vim72 ) > > - First of all, build the database (done once). > > :new > :lcd $VIMSRC/src > :!cscope -bv ./*.[ch] ./perl.xs auto/*.h auto/pathdef.c
Seems OK. I also use option -q (see man cscope). > I have searched the src/Makefile for a target doing this kind of stuff > (the way the tags target builds a Vim tagfile for the same source) but > have failed. > > It's not clear to me whether to repeat this after the sources change, > I'll have to read the cscope manpage in more detail (it seems to say > cscope is clever enough to update the database if the sources have > changed, but can I rely on that?) You often don't need to rebuild cscope DB if the code changes slightly. But if some functions are added to vim sourrce code for example, it's nicer to rebuild cscope DB or else you won't find the new functions for example. Vim source code is small anyway so rebuilding cscope DB is very fast. > BTW, here "cscope --version" anwsers: > cscope: version 15.6 On http://sourceforge.net/projects/cscope/, I see that the latest version is 15.7a, last update: Apr 30 2009. On my machine, I see: $ cscope --version cscope: version 16.0a So I'm a bit puzzled since 16.0a is newer than what website says. I don't remember when I built cscope. Maybe it was from a CVS snapshot. > - Once per session (done manually when starting to use it). First two > lines are of course not needed if already done by building the database > as shown above. Last line (setting 'cscopequickfix') can be in vimrc. It > is of course the "useful setting" given at ":help csqf" with no quotes > (also no single quotes around 'csqf'). > > :new > :lcd $VIMSRC/src > :cs add cscope.out > " use quickfix for most common queries > :set csqf=s-,c-,d-,i-,t-,e- In my ~/.vimrc, I have: if has('cscope') if filereadable(expand("$HOME/cscope.out")) cs kill -1 cs add ~/cscope.out endif set cscopeverbose " Put output of cscope in quickfix window (use :copen) set cscopequickfix=s-,c-,d-,i-,t-,e-,g- endif The "cs kill -1" is there to ensure that I don't get an error reloading the cscope DB in case I source my ~/.vimrc several times. You can find my .vimrc at: http://dominique.pelle.free.fr/.vimrc.html Regards -- Dominique --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
