My ideal scenario would be for Vim to split into two windows - first containing the script (python) I'm working on now, and the other is the result of evaluating this script. This is what I have so far:
:autocmd BufWritePost *.py redir @p | execute 'silent w !python -' | redir END
When the script is saved, the contents of the script are transferred to the python command by protocol, the output of this command is stored in the p register. What is the best way to get p into a new / empty buffer displayed in another window?
Some things I tried are blast | normal! "pp | bfirst blast | normal! "pp | bfirst blast | normal! "pp | bfirst (blast: new / empty buffer, bfirst: buffer containing the python script), but that seems to leave me in the" output "buffer and for some reason I lose syntax highlighting and need to flip between buffers so that bring them back in. I would really like to do it all in its place and not generate a temp dump file, where I connect the output of the script and prefer to avoid using any other external tools to "view" the python script file and do something, when it changes.
source share