how to search with cscope ignoring case?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

how to search with cscope ignoring case?

Issac Liao
Hi:

  recently I fall in love with cscope in vim.
  this feature is awesome.
  but then I found that I could not search text ignoring letter case.

  eg.
  I type :cs f t logdisplayer
  vim will fail to find LogDisplayer.

  this has been really frustrating.
  so I look up the manual and search through the internet.
  but I can not find a way to fix my problem.
  
  I use cscope -CRbq to build the database for cscope as suggested.(-C will enable searching case-insensitive)
  but obviously vim does not work with that.
 
  I tried :cs add cscope.out -C  too . It doesn't work.

  so I wonder is there a way to make  :cs find  searching ignoring case?
  
  thank you in advance. :)

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: how to search with cscope ignoring case?

tooth pik
On Fri, Apr 19, 2013 at 01:56:16PM +0800, Issac Liao wrote:
> Hi:

>  recently I fall in love with cscope in vim.
>  this feature is awesome.
>  but then I found that I could not search text ignoring letter case.

>  eg.
>  I type :cs f t logdisplayer
>  vim will fail to find LogDisplayer.

>  this has been really frustrating.
>  so I look up the manual and search through the internet.
>  but I can not find a way to fix my problem.

>  I use cscope -CRbq to build the database for cscope as suggested.(-C will
> enable searching case-insensitive)
>  but obviously vim does not work with that.

>  I tried :cs add cscope.out -C  too . It doesn't work.

>  so I wonder is there a way to make  :cs find  searching ignoring case?

what happens when you

    :set ignorecase

?

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: how to search with cscope ignoring case?

twong
On Friday, April 19, 2013 at 8:28:50 AM UTC-7, toothpik wrote:

> On Fri, Apr 19, 2013 at 01:56:16PM +0800, Issac Liao wrote:
> > Hi:
>
> >  recently I fall in love with cscope in vim.
> >  this feature is awesome.
> >  but then I found that I could not search text ignoring letter case.
>
> >  eg.
> >  I type :cs f t logdisplayer
> >  vim will fail to find LogDisplayer.
>
> >  this has been really frustrating.
> >  so I look up the manual and search through the internet.
> >  but I can not find a way to fix my problem.
>
> >  I use cscope -CRbq to build the database for cscope as suggested.(-C will
> > enable searching case-insensitive)
> >  but obviously vim does not work with that.
>
> >  I tried :cs add cscope.out -C  too . It doesn't work.
>
> >  so I wonder is there a way to make  :cs find  searching ignoring case?
>
> what happens when you
>
>     :set ignorecase
>
> ?
nope. `:set ignorecase` only tells vim to ignore case, not the cscope.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to search with cscope ignoring case?

jreidthompson-2

from https://sourceforge.net/p/cscope/bugs/253/

I concur with Hans. This isn't a cscope bug, and we're not here to pass on bug reportson your behalf. The cscope plugin is part of the vim project, so you need to go there. Also if you had bothered to
read the :cs help in vim, you would note that it doesn't pass options like that at all. In fact it doesn't support cscope option passing at all. The best you can do is to set the csprg option to a
wrapper script around cscope that sets the options for you there

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to search with cscope ignoring case?

Efraim Yawitz
In reply to this post by Issac Liao


On Fri, 19 Apr 2013 at 12:16, Issac Liao <[hidden email]> wrote:
Hi:

  recently I fall in love with cscope in vim.
  this feature is awesome.
  but then I found that I could not search text ignoring letter case.

  eg.
  I type :cs f t logdisplayer
  vim will fail to find LogDisplayer.

  this has been really frustrating.
  so I look up the manual and search through the internet.
  but I can not find a way to fix my problem.
  
  I use cscope -CRbq to build the database for cscope as suggested.(-C will enable searching case-insensitive)
  but obviously vim does not work with that.
 
  I tried :cs add cscope.out -C  too . It doesn't work.

  so I wonder is there a way to make  :cs find  searching ignoring case?
  
  thank you in advance. :)

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

The help states that you can add an option to the 'add' command:

        :cscope add cscope.out /usr/local/vim -C

I haven't gotten this to work yet, though.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to search with cscope ignoring case?

Tony Mechelynck
On Thu, Apr 4, 2019 at 2:00 PM Efraim Yawitz <[hidden email]> wrote:

> On Fri, 19 Apr 2013 at 12:16, Issac Liao <[hidden email]> wrote:
>>
>> Hi:
>>
>>   recently I fall in love with cscope in vim.
>>   this feature is awesome.
>>   but then I found that I could not search text ignoring letter case.
>>
>>   eg.
>>   I type :cs f t logdisplayer
>>   vim will fail to find LogDisplayer.

Have you tried using :cs f e instead? I haven't, but I have a hunch
that if one of cscope's find options can handle caseless search, it's
that one (search for an egrep pattern).

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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to search with cscope ignoring case?

Efraim Yawitz
In reply to this post by Efraim Yawitz


On Thu, 4 Apr 2019 at 15:00, Efraim Yawitz <[hidden email]> wrote:


On Fri, 19 Apr 2013 at 12:16, Issac Liao <[hidden email]> wrote:
Hi:

  recently I fall in love with cscope in vim.
  this feature is awesome.
  but then I found that I could not search text ignoring letter case.

  eg.
  I type :cs f t logdisplayer
  vim will fail to find LogDisplayer.

  this has been really frustrating.
  so I look up the manual and search through the internet.
  but I can not find a way to fix my problem.
  
  I use cscope -CRbq to build the database for cscope as suggested.(-C will enable searching case-insensitive)
  but obviously vim does not work with that.
 
  I tried :cs add cscope.out -C  too . It doesn't work.

  so I wonder is there a way to make  :cs find  searching ignoring case?
  
  thank you in advance. :)

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

The help states that you can add an option to the 'add' command:

        :cscope add cscope.out /usr/local/vim -C

I haven't gotten this to work yet, though.

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.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to search with cscope ignoring case?

Tony Mechelynck
On Sun, Apr 7, 2019 at 2:32 PM Efraim Yawitz <[hidden email]> 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 [hidden email].
For more options, visit https://groups.google.com/d/optout.