From fd2095c86e5222000d483f44e2f260b820ea6493 Mon Sep 17 00:00:00 2001 From: NotAFile Date: Wed, 29 Sep 2021 18:59:26 +0200 Subject: [PATCH] add example fish plugin --- README.md | 1 + hellpipe.fish | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 hellpipe.fish diff --git a/README.md b/README.md index d44d1cd..8d02367 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ wip: generate python scripts from (s)hell pipelines Intended to be used with a shell plugin to make those oneliners that get out of hand more manageable. +An example plugin for fish is provided in hellpipe.fish. ## Example diff --git a/hellpipe.fish b/hellpipe.fish new file mode 100644 index 0000000..105791d --- /dev/null +++ b/hellpipe.fish @@ -0,0 +1,14 @@ +# bind to a key combination of your choice, e.g. for alt-z +# bind --user \ez __hellpipeify + +function __hellpipeify + commandline -j | python3 -m hellpipe.main - > temp.py + or return 1 + __fish_disable_bracketed_paste + $EDITOR temp.py + or return 1 + __fish_enable_bracketed_paste + commandline -r -j -- "python3 temp.py" + commandline -C 999999 + commandline -f repaint +end