Viml quickfix/loclist

From wikinotes

Vim's quickfix is a global window that you can populate and use to jump between files.

Vim's loclist is a window-specific window that behaves the same as quickfix (except not being global).


asynchronous updates to quickfix/loclist


See :help setqflist-examples for lots of examples.

:copen               " open quickfix
:call setqflist([])  " clear quickfix

" append 'items' to quickfix list  ('a')
call setqflist(
    \ [],
    \ 'a',
    \ {'items': [
        \ {'filename': 'taskmage2/project/', 'lnum': 20, 'text': 'blah blah blah'}
        \ ]
    \ }
\ )

call setqflist([], 'a', { 'items': [{'filename': $HOME.'/.vimrc'}] })
:call setqflist([], ' ', {'lines': systemlist('grep -Hn main *.c')})  " populate with grep output


" /path|line-number|message
/path/to/file.txt|34|my message