When I use source insight before, when I search for some word I can press the "search forward" button to jump to next match across all project files.
For example:
But using vim with cscope, I need something like:
It's very complex.
Is there a better way to do this in Vim?
Vim allows you to redirect cscope's output to the quickfix window with the 'cscopequickfix' option. Below is the suggested value in :help 'cscopequickfix':
set cscopequickfix=s-,c-,d-,i-,t-,e-
From there, you can search for apple with:
:cs f s apple
view the list of matches with:
:cw[indow]
jump to the next match with:
:cn[ext]
jump to the previous match with:
:cp[revious]
and, of course, use the mouse or the keyboard to select entries in the quickfix window.
Bonus: add this to your vimrc to skip the :cwindow step:
augroup qf
autocmd!
autocmd QuickFixCmdPost * cwindow
augroup END
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