Sunday, April 7, 2019

Re: how to search with cscope ignoring case?

On Sun, Apr 7, 2019 at 2:32 PM Efraim Yawitz <efraim.yawitz@gmail.com> wrote:
> If anyone is still paying attention, it does work just as stated in the help. It wasn't working for me because I didn't realize the "pre-path" parameter ("/usr/local/vim" in the example) is obligatory
>
> I was trying something like:
>
> :cscope add cscope.out -C
>
> and the connection failed.

Good that you found out what was wrong.

FWIW, I have the following lines in my vimrc; I use cscope almost
exclusively to look at the Vim source, where case matters, so my use
case is not identical to yours, but maybe you could use some variation
of them, maybe with a directory argument instead of hardcoding
$VIMSRC.

The :cnoreabbrev commands are just typing shortcuts, but the :Cscope
command defined at the end makes sure that I run cscope to use its
database in the same src directory where I ran it (manually, and after
a cd command) to create its database. The autocommand defined before
that is probably not necessary but it looks "cleaner" to me than doing
nothing.

" define $VIMSRC as the src directory in our Vim source clone
let $VIMSRC = expand('~/.build/vim/vim-hg/src', ':p')

" settings for cscope
if has('cscope')
set csqf=s-,c-,d-,i-,t-,e-
set csre csverb

cnoreabbrev <expr> csa ((getcmdtype() == ':' && getcmdpos() <= 6)?
'cs add' : 'csa')
cnoreabbrev <expr> csf ((getcmdtype() == ':' && getcmdpos() <= 6)?
'cs find' : 'csf')
cnoreabbrev <expr> csfs ((getcmdtype() == ':' && getcmdpos() <= 7)?
'cs find s' : 'csfs')
cnoreabbrev <expr> csfg ((getcmdtype() == ':' && getcmdpos() <= 7)?
'cs find g' : 'csfg')
cnoreabbrev <expr> csfd ((getcmdtype() == ':' && getcmdpos() <= 7)?
'cs find d' : 'csfd')
cnoreabbrev <expr> csfc ((getcmdtype() == ':' && getcmdpos() <= 7)?
'cs find c' : 'csfc')
cnoreabbrev <expr> csft ((getcmdtype() == ':' && getcmdpos() <= 7)?
'cs find t' : 'csft')
cnoreabbrev <expr> csfe ((getcmdtype() == ':' && getcmdpos() <= 7)?
'cs find e' : 'csfe')
cnoreabbrev <expr> csff ((getcmdtype() == ':' && getcmdpos() <= 7)?
'cs find f' : 'csff')
cnoreabbrev <expr> csfi ((getcmdtype() == ':' && getcmdpos() <= 7)?
'cs find i' : 'csfi')
cnoreabbrev <expr> csh ((getcmdtype() == ':' && getcmdpos() <= 6)?
'cs help' : 'csh')
cnoreabbrev <expr> css ((getcmdtype() == ':' && getcmdpos() <= 6)?
'cs show' : 'css')

augroup cscope
au VimLeave * cs kill -1
augroup END

command -nargs=0 -bar Cscope cs add $VIMSRC/cscope.out $VIMSRC

endif



Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment