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.
Regards,
Chip Campbell
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---