Git Product home page Git Product logo

epipe's Introduction

epipe

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.

Usage

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"

A really simple example: ./epipe.gif

References

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 running emacsclient 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 original vipe of Joey Hess using shell script. However, the problem remains the same – it doesn’t support running emacsclient in the terminal.

Perl Version

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.

Final Notes

  • Tested epipe on Arch Linux and GuixSD.
  • Can’t use with -a option of emacsclient

epipe's People

Contributors

cute-jumper avatar wigust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

epipe's Issues

Provide a licence and a release tarball

Hello Junpeng,

Thank you for this program!

Could I ask you about including a LICENCE file in this Git repository? Maybe a GPL3+ would serve well for this, because most of Emacs related stuff is under GPL3+ licence. WDYT? Also a release tarball would be great. I want to publish this program to Guix[1] package collection.

[1] https://www.gnu.org/software/guix/

Oleg.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.