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"