The Missing Piping Puzzle: vipe
Today I have found a CLI tool that I have already missed a few times. This tool
is vipe
.
Use Case
Occasionally I am using vim -
to pipe an output of another command to Vim,
for example:
$ echo 'Hello world!' | vim -
However, quite often I have missed the possibility to pipe Vim contents forward. Trying to do so returns unsatisfying results:
$ echo 'Hello world!' | vim - | cat
Vim: Warning: Output is not to a terminal
vipe to the Rescue
Manpage for vipe(1)
is extremely concise. Shortening it even more:
vipe allows you to run your editor in the middle of a unix pipeline and edit the data that is being piped between programs.
As simple as that! It runs your default editor and allows you to do the magic:
Installation
vipe
is installed via moreutils
. If you are using a distro with apt
, then
run apt install moreutils
and if you are on MacOS, then go with brew install moreutils
.
Summary
I am really glad that I have discovered this tool. It might not be an every day use however, I am looking to the convenience it brings to the toolkit.