Powerful the :r! command
This reads the results of a command. It’s the
same as suspending the vi session, running a
command, redirecting its output to a temporary
file, resuming your vi session, and reading in
the contents from the temp. file.
Using the :r!
and !
commands means that any
external utility or filter can be treated as an
extension of our editor. I have occasionally used
these with scripts that pulled data from a
database, or with wget or lynx commands that
pulled data off a website, or ssh commands that
pulled data from remote systems.