feat(functiions): add fuck

This commit is contained in:
Jan-Ole Hübner 2025-04-06 19:53:51 +02:00
parent 719786d9ac
commit 85ac9a7fb4
2 changed files with 13 additions and 1 deletions

12
.zsh_functions/fuck.zsh Normal file
View file

@ -0,0 +1,12 @@
function fuck {
local nth_last=${1:-1}
if [[ "$nth_last" =~ ^[0-9]+$ ]]; then
sudo $(fc -ln -$nth_last -$nth_last)
else
echo "Usage: fuck [offset]"
return 1
fi
}
alias please='fuck'

2
.zshrc
View file

@ -21,7 +21,7 @@ unsetopt allexport
autosource youtube
autosource milan
autosource nas
autosource fuck
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"