diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 6c67023..6059a56 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -59,3 +59,14 @@ if [ $? -eq 0 ]; then eval $(thefuck --alias) fi +# change to git directory +cdg() { + local newdir + newdir=$(pgd $1) && cd $newdir +} + +_cdg() { + _arguments "1: :($( cat $GCLONE_PATH/.cdgcache | rev | cut -d '/' -f 1 | rev))" +} + +compdef _cdg cdg