diff --git a/dot_config/zsh/dot_zshrc.tmpl b/dot_config/zsh/dot_zshrc.tmpl index 3ed89a5..7179e87 100644 --- a/dot_config/zsh/dot_zshrc.tmpl +++ b/dot_config/zsh/dot_zshrc.tmpl @@ -28,16 +28,16 @@ alias_if () { alias_if_N "$1" -- "${@:2}" } +alias_if_sudo () { + alias_if_N sudo "$1" -- "${@:2}" +} + alias_if_else () { if ! alias_if_N "$1" -- "$2"; then alias "$3" fi } -alias_if_sudo () { - alias_if_N "$1" -- "${@:2}" -} - ## -------------------------------------------------- # autocompletion ## -------------------------------------------------- @@ -357,6 +357,16 @@ alias_if chezmoi \ czu="chezmoi update" \ czc="chezmoi cd" +alias_if_sudo docker \ + dr="sudo docker" \ + drc="sudo docker container" \ + drx="sudo docker exec -it" \ + drX="sudo docker exec" \ + dri="sudo docker inspect" \ + drg="sudo docker image" \ + drv="sudo docker volume" \ + drk="sudo docker compose" + alias_if xclip \ xclip-img="xclip -selection clipboard -t image/png -i"