bairui

quickfix niceties

Feb 18th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.50 KB | None | 0 0
  1. " quickfix niceties
  2. " Barry Arthur, Jan 2012
  3.  
  4. " http://stackoverflow.com/questions/1830839/how-to-open-multiple-files-in-vim-after-vimgrep
  5.  
  6. command! -nargs=+ Qfixdo call QuickFixDo(<q-args>)
  7. function! QuickFixDo(cmd)
  8.   let bufnam = {}
  9.   for q in getqflist()
  10.     let bufnam[q.bufnr] = bufname(q.bufnr)
  11.   endfor
  12.   for n in keys(bufnam)
  13.     exe 'buffer' n
  14.     exe a:cmd
  15.     update
  16.   endfor
  17. endfunction
  18.  
  19. " fill quickfix windows horizontally
  20. augroup QF
  21.   au!
  22.   au FileType qf wincmd J
  23. augroup END
Advertisement
Add Comment
Please, Sign In to add comment