Created
November 13, 2012 01:17
-
-
Save larsthegeek/4063239 to your computer and use it in GitHub Desktop.
Open all files in quickfix window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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