Want more features on Pastebin? Sign Up, it's FREE!
Guest

Tim dahlin

By: a guest on Jan 14th, 2011  |  syntax: VIM  |  size: 0.64 KB  |  views: 288  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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()
clone this paste RAW Paste Data