# ----------------------------- # Git prompt function # ----------------------------- git_prompt_info() { if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then local branch=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD) echo " %F{green}($branch)%f" fi } # ----------------------------- # Set prompt # ----------------------------- PROMPT='%n@%m%f %F{blue}%~%f$(git_prompt_info) $ '