mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
Misc updates
This commit is contained in:
9
dotfiles/zshrc.d/cdgr.zsh
Normal file
9
dotfiles/zshrc.d/cdgr.zsh
Normal file
@@ -0,0 +1,9 @@
|
||||
# Change to the root of the git repository.
|
||||
# If not in a git repo, do nothing.
|
||||
cdgr() {
|
||||
local git_root
|
||||
git_root=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||
if [ -n "$git_root" ]; then
|
||||
cd "$git_root"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user