infra/modules/terminal-life/nvim/quickfixopenall.vim
Benjamin Yule Bädorf 56ea689de6
feat: add nix config to this repository
This used to live in the old pub-solar/os repository in the `momo/main`
branch. This commit changes that so this repository has all code from
terraform to nix.
2024-02-25 17:41:25 +01:00

21 lines
500 B
VimL

"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()