I am currently trying to make a server client architecture for any program using pipes as its stdin and stdout.
I do have the whole server-thing working, and it's communicating through named pipes(fifo). What I am trying to do is to read the content of the stdout pipe into a vim buffer, constantly (asynchronously), and I am looking for the most elegant solution to this problem.
Say I have a program, python, communicating through 2(3 if you account stderr but it's not relevant to finding the solution) pipes, namely PIPE_IN as its stdin, and PIPE_OUT as its stdout.
I can write to the pipe easily from vim (with :w), how would I however read from PIPE_OUT into a vim or neovim buffer?
This is not supposed to be portable to non-UNIX systems, however I would like to keep compatibility with both vim and neovim as much as possible. What would be your recommendations to do so? Should I use the vimscript language for this? Is using vim's command-line mode better in that case? What other, probably more elegant solutions, am I missing?
Thanks in advance!
NB: The server project's code can be found at Soulthym/pyper on GitHub for testing purposes.
:r /path/to/fifo? Doesn't work? Maybe:r! cat /path/to/fifo? - phd:r! cat /path/to/fifoseems to somewhat function under neovim, although it is synchronous and freezes vim until ICtrl+Cthe command - Soulthym