On Fri, Sep 18, 2009 at 09:45:14AM -0700, Gary Johnson wrote:
> 
> On 2009-09-18, Gregory Margo wrote:
> > On Fri, Sep 18, 2009 at 11:29:48PM +0800, Steven Woody wrote:
> > > I feel happy with ctags except one thing:  while I can jump to a
> > > function/variable definition, I can not however get  a list for all the
> > > references to the function/variable?  How vim gurus do it?
> > 
> > 
> > I tend to use a big blunt instrument: grep.  It works on any
> > language, not the limited few that cscope/id-utils/global support.
> > And it works on any string, not just functions/variables.
> > 
> > Here are two scripts/mappings from my .vimrc that I use all the time.
> > The "_lg" mapping creates a new buffer with the matches, and
> > the "_le" mapping opens the appropriate file from a given match.
> 
> Are you aware of vim's built-in :grep command?
> 
>     :help :grep

+1 for this suggestion.  It has several advantages, not the least of
which being that it is much simpler.  And it uses the quickfix list.

:help quickfix

While we're talking about searching source code, I would like to
direct your attention to ack: http://betterthangrep.com/

Set your 'grepprg' to ack.  It will change your life.


-- 
Erik Falor
Registered Linux User #445632 http://counter.li.org

Attachment: signature.asc
Description: Digital signature

Reply via email to