Created
August 13, 2023 07:15
-
-
Save fariswd/16cf4e91e1a3013dc67ba0ea96ef39b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load version control information | |
autoload -Uz git_branch_test_color | |
git_branch_test_color() { | |
local ref=$(git symbolic-ref --short HEAD 2> /dev/null) | |
if [ -n "${ref}" ]; then | |
local gitstatuscolor='%F{yellow}' | |
echo "%B${gitstatuscolor} (${ref})%b" | |
else | |
echo "" | |
fi | |
} | |
setopt PROMPT_SUBST | |
PROMPT='%F{green}%n/> %1d$(git_branch_test_color)%F{none} $ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment