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?
To split the vim screen horizontally, or open a new workspace at the bottom of the active selection, press Ctrl + w , followed by the letter 's' . In the example below, the left section has been split into two workspaces.
Show activity on this post. In vim I can open a file in a vertical split by using the command vs myfile. txt and I can open a file in a new editor, in read only mode with vim -R myfile. txt .
To open a new VIM window next to the existing one, press <Ctrl>+<w> then press <v>. You can move to the left window again by pressing <Crtl>+<w> and then pressing <h>. To open a new VIM window on the bottom of the currently selected window, press <Ctrl>+<w> then press <s>.
oneliner:
:make | copen
See http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix-window
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With