From f2f7054011eb4fac8684064bdfdd127fdeb865fb Mon Sep 17 00:00:00 2001 From: Bas Grolleman Date: Tue, 1 Jul 2025 16:44:38 +0200 Subject: [PATCH] zsh update to add zoxide --- zshrc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/zshrc b/zshrc index c9577c0..aaf0522 100644 --- a/zshrc +++ b/zshrc @@ -3,3 +3,32 @@ export PATH="${HOMEBREW_PREFIX}/opt/openssl/bin:$PATH" eval "$(direnv hook zsh)" [[ -v PS1 ]] && [[ ! -v TMUX ]] && tmux + +# Function to get the current Git branch and remote +git_info() { + local branch + local remote + + # Get the current branch + branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) + + # Get the current remote + remote=$(git config --get remote.origin.url 2>/dev/null) + + # Format the output + if [[ -n $branch ]]; then + #echo "[$branch] $(basename "$remote")" + echo "[$branch]" + fi +} +setopt PROMPT_SUBST +PROMPT='%F{green}%n@%m %F{blue}%~ %F{yellow}$(git_info)%f %# ' + +eval "$(zoxide init zsh)" +alias cd=z + +cat <