From d1a40dd49d72df2c88615f6e348df5b9f13bc976 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Mon, 14 Oct 2024 16:01:35 -0400 Subject: [PATCH] ADD docker aliases (finally) --- dot_config/zsh/dot_zshrc.tmpl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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"