From 4ef63083455f922787e7d01ff1927279cb3391b6 Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Wed, 27 Feb 2019 12:13:07 -0800 Subject: [PATCH] Add thefuck support to fish config --- fish/functions/fuck.fish | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 fish/functions/fuck.fish diff --git a/fish/functions/fuck.fish b/fish/functions/fuck.fish new file mode 100644 index 0000000..5ba4fd1 --- /dev/null +++ b/fish/functions/fuck.fish @@ -0,0 +1,9 @@ +function fuck -d "Correct your previous console command" + set -l fucked_up_command $history[1] + env TF_SHELL=fish TF_ALIAS=fuck PYTHONIOENCODING=utf-8 thefuck $fucked_up_command | read -l unfucked_command + if [ "$unfucked_command" != "" ] + eval $unfucked_command + builtin history delete --exact --case-sensitive -- $fucked_up_command + builtin history merge ^ /dev/null + end +end