dotfiles/roles/zsh/files/config/configs/prompt.zsh

16 lines
409 B
Bash
Raw Normal View History

2022-05-27 17:31:52 +00:00
source $ZDOTDIR/oh-my-zsh/git.zsh
2022-05-23 11:26:36 +00:00
2022-05-27 17:31:52 +00:00
git_prompt_prefix() {
local tag="$(git describe --tags 2> /dev/null)"
2022-05-23 11:26:36 +00:00
2022-05-27 17:31:52 +00:00
[ -n "${tag}" ] && echo "%{$fg[yellow]%}${tag}%{$reset_color%} "
}
git_prompt_suffix() {
local branch="$(git_current_branch)"
2022-05-23 11:26:36 +00:00
2022-05-27 17:31:52 +00:00
[ -n "${branch}" ] && echo " on %{$fg[green]%}${branch}%{$reset_color%}"
2022-05-23 11:26:36 +00:00
}
2022-05-27 17:31:52 +00:00
export PS1="$(git_prompt_prefix)in %{$fg[blue]%}%1d/%{$reset_color%}$(git_prompt_suffix) "