Skip to content

Instantly share code, notes, and snippets.

@larsthegeek
Created November 13, 2012 01:17
Show Gist options
  • Save larsthegeek/4063239 to your computer and use it in GitHub Desktop.
Save larsthegeek/4063239 to your computer and use it in GitHub Desktop.
Open all files in quickfix window
" quickfixopenall.vim
"Author:
" Tim Dahlin
"
"Description:
" Opens all the files in the quickfix list for editing.
"
"Usage:
" 1. Perform a vimgrep search
" :vimgrep /def/ *.rb
" 2. Issue QuickFixOpenAll command
" :QuickFixOpenAll
function! QuickFixOpenAll()
if empty(getqflist())
return
endif
let s:prev_val = ""
for d in getqflist()
let s:curr_val = bufname(d.bufnr)
if (s:curr_val != s:prev_val)
exec "edit " . s:curr_val
endif
let s:prev_val = s:curr_val
endfor
endfunction
command! QuickFixOpenAll call QuickFixOpenAll()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment