mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
16 lines
489 B
Bash
16 lines
489 B
Bash
function git_prompt_info() {
|
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
|
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
|
}
|
|
|
|
function get_pwd() {
|
|
print -D $PWD
|
|
}
|
|
|
|
PROMPT=$'%{$fg[cyan]%}%m $fg[yellow]$(get_pwd) $(git_prompt_info)\
|
|
%{$fg[red]%}➜ %{$reset_color%} '
|
|
|
|
ZSH_THEME_GIT_PROMPT_PREFIX="[git:"
|
|
ZSH_THEME_GIT_PROMPT_SUFFIX="]$reset_color"
|
|
ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]+"
|
|
ZSH_THEME_GIT_PROMPT_CLEAN="$fg[green]"
|