From 51291c9b62342038f5da81bec0ca2ff0fbeb6ad9 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Tue, 21 Nov 2017 18:11:53 -0500 Subject: [PATCH] Add an easy way to cd into the root git directory to .zsh_functions --- dotfiles/.zsh_functions | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dotfiles/.zsh_functions b/dotfiles/.zsh_functions index 130b77c6..d227d8b2 100644 --- a/dotfiles/.zsh_functions +++ b/dotfiles/.zsh_functions @@ -70,6 +70,12 @@ function lab() { cd $(basename "$1") } +# Easily cd into the "home" directory of any repository you're working in +# This needs to be a function instead of an alias since it relies on `external calls` +function gh() { + cd `git rev-parse --show-toplevel` +} + #################################################################### # Utility functions ####################################################################