Hi Charles,

On 9/11/07, Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:
>
> Mikolaj Machowski wrote:
>
> >Dnia wtorek 11 wrzesieĊ„ 2007, Ed S. Peschko napisaĊ‚:
> >
> >
> >>hey all,
> >>
> >>Is there a way of searching through multiple buffers? ie: I'd like a
> >>derivative of '/' to be able to span files, ie: if it doesn't find it in
> >>one file, it goes to the next in the bufferlist, and so on..
> >>
> >>Having the ability to autosave if it exits the buffer would be cool
> >>too..
> >>
> >>
> >>
> >
> >If files are sharing common element in name you can use:
> >
> >:vimgrep /re/ {namewithwildcards}
> >
> >For buffers you can also use
> >
> >:bufdo vimgrep /re/ %
> >
> >But it has few downsides: matches for all files will be saved into
> >separated quickfix lists, Vim will remember only last ten lists.
> >
> >But you could probably write some simple script to save all data in
> >external error list and later load it.
> >
> >:help quickfix
> >:help location-list
> >
> >
> Well, I was going to suggest
>
> :let qlist=[]
> :bufdo silent vimgrep /pattern/ % | call add(qlist,getqflist())
> :call setqflist(qlist)
> :cope
>
> Unfortunately, the formats for what getqflist() delivers and setqflist()
> takes are different, and beating them into compatiblity is more than I
> want to attempt at the moment.
>

This does work. You have to use extend() instead of add() in
the above commands. When you call add(), the current quickfix
list is added as a single item to qlist.

- Yegappan

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui