Re: Cscope find: help

2007-04-19 Thread Ashwin Bharambe

Thanks a lot! That helps ...

Ashwin

On 4/17/07, Gary Johnson <[EMAIL PROTECTED]> wrote:

On 2007-04-17, Ashwin Bharambe <[EMAIL PROTECTED]> wrote:
>  Hi,
>
>  I would like to filter the results that cscope find sends using some
>  pipe. For example, here's what I would like to do
>:cs find e word | grep -w word
>
>  This way I can easily add in some things which cscope find doesn't do,
>  sadly. What would be the best way to achieve this? Changing vim code?
>  Or writing vim functions? Sorry, I am new to hacking vim, but I have a
>  lot of experience using vim...

I'm in a little bit of a hurry, so this will be short on details.
You can run cscope like grep, executing it once for each search
instead of having it run in the background as it does when you use
the :cs commands.  Using it that way, you can set 'grepprg' to a
pipeline something like this:

cscope  $* | grep $*

and just invoke it within vim as:

:grep word

See

:help grepprg

I did something like this for a while to get the output of certain
cscope commands into the quickfix list before the 'cscopequickfix'
option was added to vim.  On the machine I was using, I didn't even
notice any performance degradation over the equivalent search using
":cs find".

HTH,
Gary

--
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Mobile Broadband Division
 | Spokane, Washington, USA




--
Buxfer - Track Your Money. Effortlessly.  http://www.buxfer.com


Re: Cscope find: help

2007-04-17 Thread Gary Johnson
On 2007-04-17, Ashwin Bharambe <[EMAIL PROTECTED]> wrote:
>  Hi,
> 
>  I would like to filter the results that cscope find sends using some
>  pipe. For example, here's what I would like to do
>:cs find e word | grep -w word
> 
>  This way I can easily add in some things which cscope find doesn't do,
>  sadly. What would be the best way to achieve this? Changing vim code?
>  Or writing vim functions? Sorry, I am new to hacking vim, but I have a
>  lot of experience using vim...

I'm in a little bit of a hurry, so this will be short on details.  
You can run cscope like grep, executing it once for each search 
instead of having it run in the background as it does when you use 
the :cs commands.  Using it that way, you can set 'grepprg' to a 
pipeline something like this:

cscope  $* | grep $*

and just invoke it within vim as:

:grep word

See

:help grepprg

I did something like this for a while to get the output of certain 
cscope commands into the quickfix list before the 'cscopequickfix' 
option was added to vim.  On the machine I was using, I didn't even 
notice any performance degradation over the equivalent search using 
":cs find".

HTH,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Mobile Broadband Division
 | Spokane, Washington, USA


Cscope find: help

2007-04-17 Thread Ashwin Bharambe

Hi,

I would like to filter the results that cscope find sends using some
pipe. For example, here's what I would like to do
  :cs find e word | grep -w word

This way I can easily add in some things which cscope find doesn't do,
sadly. What would be the best way to achieve this? Changing vim code?
Or writing vim functions? Sorry, I am new to hacking vim, but I have a
lot of experience using vim...

Thanks!
Ashwin
--
Buxfer - Track Your Money. Effortlessly.  http://www.buxfer.com