Open all files in the quickfix window in tabs

1 Point

Andrew Radev Andrew Radev

5 years ago

The :Ctabs command takes all files that are referenced in the quickfix window and opens them in new tabs. You can then just review the files instead of going over them match by match (having multiple matches in a single file).

command! Ctabs call s:Ctabs()
function! s:Ctabs()
  let files = {}
  for entry in getqflist()
    let filename = bufname(entry.bufnr)
    let files[filename] = 1
  endfor

  for file in keys(files)
    silent exe "tabedit ".file
  endfor
endfunction