> On Jun 22, 9:27 pm, Jim Green <student.northwest...@gmail.com> wrote:
>> Hi vim community,
>> I need to constantly perform a grepping of a string(eg, sth in logs)
>> from a large code base, now I use grep on the command line to do this.
>> I just started using ctags but it can not do the grepping of arbitrary
>> string for me.
>>
>> could any vim users point me to a popular tool that I can use to
>> improve my efficiency, I use only vim to browse and write code so I
>> hope this is not off topic here.
>>
>
> You don't specify the language you're coding in, but I started using
> Cscope fairly recently for C code, and it works pretty well.
> Supposedly it allows searching for grep-style patterns, but I haven't
> really used that feature. Vim has a built-in cscope interface that
> works well for my needs.
Yes, cscope does a good job at finding grep patterns
(among other things).
Example:
# Create a cscope DB with all your source files
$ find . -type f -name '*.[ch]' -print | cscope -i - -b -q -f cscope.out
# Add this in your ~/.vimrc:
if has('cscope')
cs kill -1
cs add cscope.out
set cscopeverbose
set cscopequickfix=s-,c-,d-,i-,t-,e-,g-
endif
# Then to search for patterns:
:cs find e your_pattern
:copen command can also come handy to open a QuickFix window
-- Dominique
--
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
No comments:
Post a Comment