SHARE
TWEET

Tim dahlin

a guest Jan 14th, 2011 437 Never
  1. " quickfixopenall.vim
  2. "Author:
  3. "   Tim Dahlin
  4. "
  5. "Description:
  6. "   Opens all the files in the quickfix list for editing.
  7. "
  8. "Usage:
  9. "   1. Perform a vimgrep search
  10. "       :vimgrep /def/ *.rb
  11. "   2. Issue QuickFixOpenAll command
  12. "       :QuickFixOpenAll
  13.  
  14. function!   QuickFixOpenAll()
  15.     if empty(getqflist())
  16.         return
  17.     endif
  18.     let s:prev_val = ""
  19.     for d in getqflist()
  20.         let s:curr_val = bufname(d.bufnr)
  21.         if (s:curr_val != s:prev_val)
  22.             exec "edit " . s:curr_val
  23.         endif
  24.         let s:prev_val = s:curr_val
  25.     endfor
  26. endfunction
  27.  
  28. command! QuickFixOpenAll         call QuickFixOpenAll()
RAW Paste Data
Top