While editing files I often encounter the following task: I have a standalone script that takes input and outputs a modified version of it (could be sort
, could be a sed script, could be a more complicated python script) and I want to run it on a block of text within vim.
This answer explains how to feed a text block to an external script and I assume that one can similarly read a script's output into a file using :r
. But how can I do both: feed text out of vim to an external script and its output back into vim?