On 18:53 Wed 21 Mar     , Roman Dobosz wrote:
> On Wed, 21 Mar 2012 09:37:58 -0400
> Taylor Hedberg <tmhedb...@gmail.com> wrote:
> 
> > If you search with :vimgrep, the results will be placed in the quickfix
> > window:
> > 
> >     :vimgrep /your search pattern here/ %
> >     :copen
> 
> Great!
> 
> Is it possible to vimgrep all opened buffers, not just the current
> one?
> 
> -- 
> Roman Dobosz <gry...@gmail.com>
> 
> -- 
> 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 can try:
bufdo vmigrepadd /pattern/j %

(with j vimgrep will not jump to first occurrence of the pattern, i.e. with
bufdo this would be the first in the last buffer)

But note that you need first clear quickfix list. To do that you can use:
:call setqflist([])

You can make a function and a command:

function! Search(pattern)
    call setqflist([])
    exe "bufdo vimgrepadd /".a:pattern."/j %"
endfunction
command! -nargs=1 Search :call Search(<q-args>)

Best,
Marcin

-- 
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

Reply via email to