Last active
September 9, 2021 02:01
-
-
Save 3Easy/18e13f75338535970c69a0d8aeb2348e 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
# ~/.zshrc (goes in the home directory, e.g. next to apps, dekstop, documents…) | |
# Find and set branch name var if in git repository. | |
function git_branch_name() | |
{ | |
branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}') | |
if [[ $branch == "" ]]; | |
then | |
: | |
else | |
echo '- ('$branch')' | |
fi | |
} | |
# Enable substitution in the prompt. | |
setopt prompt_subst | |
# Config for prompt. PS1 synonym. | |
prompt='%2/ $(git_branch_name) > ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment