I am editing C source code in vim. I'd like to:
- Write current contents of the buffer (which is potentially a scratch buffer) to my favorite C compiler's stdin (essentially, pipe buffer to a command)
- Read from the pipe (that potentially reads stderr as well, because compilation may fail), and pipe compiler's stdout to a new buffer/split in vim
- (Optionally) set the new buffers filetype to whatever I specify (generally assembly)
I'd prefer vsplit, instead of a new buffer, but I don't know whether that's possible. I am not an expert in vim. I have found this, and this answers. The latter one is closest to what I desire. It uses a temporary buffer as far as I understood; is possible to do the same thing without temporary files, but directly dealing with stdio? If not, I'll go ahead and use it.