Use your favorite editor in the pipeline, featuring the support for
running emacsclient
in the terminal.
This tool enables the use of emacs(client) for interactive editing of the output/input of shell commands.
First, set an alias for epipe
:
alias epipe=/path/to/epipe
Then you can use epipe
in one of the following ways:
command1 | epipe epipe | command1 command1 | epipe | command2
Since emacs can now be used in the pipeline, epipe
saves us from writing
grep
, sed
, awk
, etc., in order to process the output/input of shell
commands. The use of epipe
can also replace some other interactive commands,
for example, the interactive grep, percol.
You need to set either EDITOR
or VISUAL
environment variable. If you don’t
set EDITOR
or VISUAL
, epipe
uses emacs
as the default editor. In order
to use emacsclient
as the editor, you can set EDITOR
environment variable:
export EDITOR="emacsclient -ct"
This idea has been implemented in vipe
, but none of the current
implementation supports emacsclient
in the terminal. That said, setting
EDITOR
to emacsclient -t
doesn’t work for vipe
while setting EDITOR
to
emacsclient
works since it creates/uses the frame in the window system
instead of the current terminal.
- vipe of moreutils: To the best of my knowledge, the original
vipe
is implemented by Joey Hess using perl. But it doesn’t support runningemacsclient
in the terminal. - juliangruber/vipe: I found this repo after I wrote the code. This one is
similar to
epipe
since the author also rewrote the originalvipe
of Joey Hess using shell script. However, the problem remains the same – it doesn’t support runningemacsclient
in the terminal.
I also put a modified verion of Joey’s vipe
in this repo: epipe.pl
. The
code of vipe
is changed a little bit to support emacsclient
. You can check
it out if interested.
- Only test
epipe
on Arch Linux. - Can’t use with
-a
option ofemacsclient