mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-31 10:11:14 +00:00
parent
16f9ab6538
commit
a3cec536b2
@ -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
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user