vim redirect output to quickfix

后端 未结 4 2054
孤城傲影
孤城傲影 2021-02-13 10:20

Is it possible to redirect an output of a command to the quick fix window?

The command I am running is

:!java %:r

and was hoping the o

4条回答
  •  余生分开走
    2021-02-13 10:35

    Please note that the quickfix window is for specific output (e.g. of compiler or syntax checker tools) which includes references (i.e. line and column numbers) to the current buffer. There's a lot of infrastructure around this: 'makeprg', 'errorformat', etc., usually bundled into a compiler plugin.

    Though you can redirect arbitrary output into the quickfix window, it provides little benefit (and has the downside of clobbering 'makeprg') over reading the output of an external program into a new scratch buffer, e.g. like this:

    :new|0read !java #:r
    

提交回复
热议问题