From 85ac9a7fb4bada63014f0a45464814a440cf142d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Ole=20Hu=CC=88bner?= Date: Sun, 6 Apr 2025 19:53:51 +0200 Subject: [PATCH] feat(functiions): add fuck --- .zsh_functions/fuck.zsh | 12 ++++++++++++ .zshrc | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .zsh_functions/fuck.zsh diff --git a/.zsh_functions/fuck.zsh b/.zsh_functions/fuck.zsh new file mode 100644 index 0000000..21870a0 --- /dev/null +++ b/.zsh_functions/fuck.zsh @@ -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' + diff --git a/.zshrc b/.zshrc index 55831d2..4f22c1e 100755 --- a/.zshrc +++ b/.zshrc @@ -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"