From e42645df00537592024afd21b0b754e634c58419 Mon Sep 17 00:00:00 2001 From: Mitchell Ludwig Date: Fri, 22 Nov 2019 12:14:25 -0700 Subject: [PATCH] Adding g to zsh --- bin/autojump.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/autojump.zsh b/bin/autojump.zsh index a761206..2366b00 100644 --- a/bin/autojump.zsh +++ b/bin/autojump.zsh @@ -123,3 +123,14 @@ jco() { jo $(pwd) ${@} fi } + +# Jump around a git repo +g() { + if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then + autojump ${@} + return + else + REPO_ROOT=`git rev-parse --show-toplevel` + j "$REPO_ROOT" ${@} + fi +}