How to run make in vim and open results in a split window?

23,335

oneliner:

:make | copen

See http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix-window

Share:
23,335
balki
Author by

balki

A computer enthusiast.

Updated on July 28, 2020

Comments

  • balki
    balki over 3 years

    I use vim for coding. When I have to compile the current file, Currently I use :!g++ % && ./a.out or :make. The errors/output displayed are gone when I press enter and get back to the file. I wish the errors and output are displayed in a vertical split by the side. It would be nice if output and error streams are in separate buffers. How can this be done? Errors and Output buffer(s) should be updated when I compile again and it should not create new buffers. How can do this? some vim pluggin/function? or a oneliner :P?