Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vim

ide

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?

like image 308
balki Avatar asked Jul 01 '11 14:07

balki


People also ask

How to open split windows in vim?

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.

How to open file in vertical split vim?

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 .

How to open new window in vim?

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>.


1 Answers

oneliner:

:make | copen 

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

like image 99
David Winslow Avatar answered Oct 14 '22 01:10

David Winslow