Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add results to the buffers list? #133

Open
rafaelrinaldi opened this issue Mar 11, 2016 · 1 comment
Open

Add results to the buffers list? #133

rafaelrinaldi opened this issue Mar 11, 2016 · 1 comment

Comments

@rafaelrinaldi
Copy link

Is there a way to add all the search matches to the buffers list? That would be really handy for "search and replace" kinda thing.

Thanks.

@rafaelrinaldi
Copy link
Author

Just as a reference, there's this screencast on Vimcasts.org that suggests a simple snippet to populate the arglist with everything inside the quickfix list.

command! -nargs=0 -bar Qargs execute 'args' QuickfixFilenames()
function! QuickfixFilenames()
  " Building a hash ensures we get each buffer only once
  let buffer_numbers = {}
  for quickfix_item in getqflist()
    let buffer_numbers[quickfix_item['bufnr']] = bufname(quickfix_item['bufnr'])
  endfor
  return join(map(values(buffer_numbers), 'fnameescape(v:val)'))
endfunction

It would be nice to trigger this from ag.vim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant