function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
setopt PROMPT_SUBST
export PROMPT='%{%F{245}%}%n %{%F{normal}%}%2~ %{%F{green}%}$(parse_git_branch) %{%F{normal}%}$%{%f%} '
reference: link
function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
setopt PROMPT_SUBST
export PROMPT='%{%F{245}%}%n %{%F{normal}%}%2~ %{%F{green}%}$(parse_git_branch) %{%F{normal}%}$%{%f%} '
reference: link
Thank you so much! @neiloler
Thank you!
Thank you for this!
Thank you so much!
Thank you!! @neiloler . I got inspired by your post and tweaked it a bit.
https://gist.github.com/jsohndata/7d5a252de861c2fe3c1eb4c4143be02d
Some how I missed all the notifications for the kind thanks here, thanks! 🙂
Thanks for your feedback! @neiloler
I applied your feedback.