diff --git a/Shell-aliases.md b/Shell-aliases.md index fdb5856..be632c2 100644 --- a/Shell-aliases.md +++ b/Shell-aliases.md @@ -9,8 +9,16 @@ alias fuck='eval $(thefuck $(fc -ln -1))' Add this function to `config.fish`: ```fish -function fuck - eval (thefuck $history[1]) +function __thefuck_repl -d 'Replace operators into fish-compatible' + set -l tmp (echo $argv | sed 's/ && / ; and /g') + echo $tmp | sed 's/ || / ; or /g' +end + +function fuck -d 'Correct your previous console command' + set -l eval_script (mktemp 2>/dev/null ; or mktemp -t 'thefuck') + thefuck $history[1] > $eval_script + eval (__thefuck_repl (cat $eval_script)) + rm $eval_script end ```