Skip to content

Commit

Permalink
feat(zsh): add cdg alias
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasnorrby committed Jul 15, 2021
1 parent 0201576 commit d967143
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion shell/zsh/aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,20 @@ fi

alias chx="chmod +x"

function ns() {
ns() {
touch "$1"
chmod +x "$1"
}

cdt() {
cd "$(mktemp -d)"
}

cdg() {
if ! git rev-parse HEAD > /dev/null 2>&1; then
echo "Not in a git repository"
return 1
fi

cd "$(git rev-parse --show-toplevel)"
}

0 comments on commit d967143

Please sign in to comment.