From ec540cef152ec05a8e45d51e6b2e0064a3ce7aa5 Mon Sep 17 00:00:00 2001 From: Pablo Aguiar Date: Wed, 8 Jul 2015 13:38:23 -0300 Subject: [PATCH] Update fuck function for Fish Shell --- Shell-aliases.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Shell-aliases.md b/Shell-aliases.md index e433693..6c1a708 100644 --- a/Shell-aliases.md +++ b/Shell-aliases.md @@ -16,15 +16,16 @@ alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R' Add this function to `config.fish`: ```fish +set TF_ALIAS fuck function fuck -d 'Correct your previous console command' set -l exit_code $status set -l eval_script (mktemp 2>/dev/null ; or mktemp -t 'thefuck') - set -l fucked_up_command $history[1] - thefuck $fucked_up_command > $eval_script + set -l fucked_up_commandd $history[1] + thefuck $fucked_up_commandd > $eval_script . $eval_script rm $eval_script if test $exit_code -ne 0 - history --delete $fucked_up_command + history --delete $fucked_up_commandd end end ```