dotfiles/dot_config/fish/private_functions/fuck.fish

10 lines
425 B
Fish
Raw Normal View History

2022-04-18 09:36:00 +02:00
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