├── README.md └── plugin └── qargs.vim /README.md: -------------------------------------------------------------------------------- 1 | Note: The functionality provided by this project has been made largely obsolete in recent versions of vim. :cdo and :cfdo allow you operate directly on the quickfix list instead of first populating the argument list from the quickfix list. 2 | 3 | A Vim plugin that adds a :Qargs utility command, for populating the argument 4 | list from the files in the quickfix list. 5 | 6 | For an example of usage, refer to the question [Search & replace using quickfix list in Vim](http://stackoverflow.com/a/5686810/128850). 7 | -------------------------------------------------------------------------------- /plugin/qargs.vim: -------------------------------------------------------------------------------- 1 | command! -nargs=0 -bar Qargs execute 'args' QuickfixFilenames() 2 | function! QuickfixFilenames() 3 | " Building a hash ensures we get each buffer only once 4 | let buffer_numbers = {} 5 | for quickfix_item in getqflist() 6 | let bufnr = quickfix_item['bufnr'] 7 | " Lines without files will appear as bufnr=0 8 | if bufnr > 0 9 | let buffer_numbers[bufnr] = bufname(bufnr) 10 | endif 11 | endfor 12 | return join(map(values(buffer_numbers), 'fnameescape(v:val)')) 13 | endfunction 14 | 15 | --------------------------------------------------------------------------------