From dcd19eeb42e9633a3cc99080692d0e8e1f619159 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 12 Dec 2017 09:07:14 +0100 Subject: [PATCH] Invert s and sudo to be able to use autocompletion with both. --- zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index 7892ae4..3bee617 100644 --- a/zshrc +++ b/zshrc @@ -52,7 +52,7 @@ fi # Faire en sorte que sudo puisse également utiliser les alias! (c'est l'espace qui fait toute la différence) # `man zshall` partie Aliasing: "If the text ends with a space, the next word in the shell input is treated as though it were in command position for # purposes of alias expansion. " -alias sudo='sudo ' +alias s='sudo ' if [ ${USER} != "root" ]; then alias sc='sudo systemctl ' alias sd='sudo docker' @@ -359,7 +359,7 @@ alias stat_sys="echo ' ' && uname -a && echo ' '&& uptime &&echo ' '&& df && ech ###################################### # Sudo -function s() { +function sudo() { if alias "${1}" &> /dev/null ; then #$(type "$1" | sed -E 's/^.*`(.*).$/\1/') "${@:2}" command -v "${1}" | \grep -o -P "(?<=\').*(?=')" | xargs sudo -E env "PATH=$PATH"