From d0c995222c2d0d4195d1851ac76a2f9d655fb59c Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Mon, 18 Apr 2022 09:36:00 +0200 Subject: [PATCH] Add fuck alias --- dot_config/fish/private_functions/fuck.fish | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 dot_config/fish/private_functions/fuck.fish diff --git a/dot_config/fish/private_functions/fuck.fish b/dot_config/fish/private_functions/fuck.fish new file mode 100644 index 0000000..4c6e37d --- /dev/null +++ b/dot_config/fish/private_functions/fuck.fish @@ -0,0 +1,9 @@ +function fuck --description '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 THEFUCK_ARGUMENT_PLACEHOLDER $argv | read -l unfucked_command + if [ "$unfucked_command" != "" ] + eval $unfucked_command + builtin history delete --exact --case-sensitive -- $fucked_up_command + builtin history merge + end +end