From 8cdedc542b8a98257dd94a48cc945b19c36832e3 Mon Sep 17 00:00:00 2001 From: lhark Date: Sun, 7 Jun 2015 00:24:41 +0200 Subject: [PATCH] Adds self updating to zshrc --- zshrc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index d11bd26..54c49a5 100644 --- a/zshrc +++ b/zshrc @@ -12,6 +12,17 @@ # Ajout de */sbin au PATH (pour ifconfig en particulier) export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:~/bin +# Check for update +cd /home/$USER/rc +if $(git status --porcelain -b 2> /dev/null | grep '^## .*behind' &> /dev/null); then + echo "Type Y to update .zshrc: \c" + read line + if [ "$line" = Y ] || [ "$line" = y ]; then + git pull --rebase --stat origin master + fi +fi +cd $OLDPWD + # Configuration for virtualenv export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper.sh > /dev/null 2>&1 @@ -45,7 +56,14 @@ alias ipr='ip address && echo && ip route' alias which='which -a' alias gg='git log --oneline --abbrev-commit --all --graph --decorate --color' # À tester un jour :) -#alias -s ps=gv +# alias -s ps=gv +# Le fameux cd ...etc +alias cd ...=cd ../.. +alias cd ....=cd ../../.. +alias cd .....=cd ../../../.. +alias cd ......=cd ../../../../.. +alias cd .......=cd ../../../../../.. +alias cd ........=cd ../../../../../../.. # Demande confirmation pour 'rm *' -> ou unsetopt rm_star_silent