Vim 8.1's release note seems to indicate that you can feed output from make running in a terminal window to a quickfix list, but I couldn't find any detailed explanation. Is there a way to do this automatically, or do I have to manually add to the quickfix list using :caddbuffer
?
2 Answers
I have made a small plugin vpager. That allows to dump the terminal output back into Vim.
The last commit in addition allows to use the output and dump it into the quickfix list. So you can simply do :make |vpager -Q
and it should be loaded back in Vim.
(It might need adjustments for the errorformat setting, not sure).
excerpt from the README:
git diff | vpager -nC 'ft=diff'
Copies the output of git diff into a buffer inside Vim. Any previous
output in the buffer will be cleared and the filetype will be set
to "diff", for proper syntax highlighting.
grep -n <searchterm> files | vpager -Q
Parses the grep -n output, copies it back into the quickfix buffer
and opens the first result in a new window.
:make
or ALE. If you are searching, then use:grep
. Otherwise you will probably need to do something like:cgetbuffer
or more likely<c-w>N
then yank the output,:cexpr @@
:make
and:grep
, but it bothers me how it blocks the whole editor while it's running. Using the terminal window like in the release note looks like a promising alternative. The passage in the release note that @Mass metioned seems to suggest that there's an easy way to do this, but I'm not really sure.