zshrc.d/20-prompt.zrc
changeset 44 157f894ef9f7
parent 40 6eeab84c3f15
child 49 06af8cc97cc1
equal deleted inserted replaced
43:7b48c4ff8d36 44:157f894ef9f7
    71 source $ZDOTDIR/tools/git-prompt.sh > /dev/null 2>&1
    71 source $ZDOTDIR/tools/git-prompt.sh > /dev/null 2>&1
    72 function __git_prompt_info {
    72 function __git_prompt_info {
    73   r=$(__git_ps1)
    73   r=$(__git_ps1)
    74   # If GIT_PS1_SHOWUNTRACKEDFILES is used, we need to escape the %
    74   # If GIT_PS1_SHOWUNTRACKEDFILES is used, we need to escape the %
    75   r=${r//\%/%%}
    75   r=${r//\%/%%}
    76   if [ ! -z $r ]; then echo -e "\n%Bgit%b$r"; fi
    76   if [[ ! -z $r ]]; then echo -e "\n%Bgit%b$r"; fi
    77 }
    77 }
    78 
    78 
    79 function __prompt_set_dev {
    79 function __prompt_set_dev {
    80     # Prompt complet sur 2 lignes, couleurs, avec un indicateur de dépôt git/hg
    80     # Prompt complet sur 2 lignes, couleurs, avec un indicateur de dépôt git/hg
    81     local -a lines pline
    81     local -a lines pline
   180     PS1="%D{%m%d} %{$fg[cyan]%}%D{%H:%M}%{$reset_color%} "
   180     PS1="%D{%m%d} %{$fg[cyan]%}%D{%H:%M}%{$reset_color%} "
   181     PS1=$PS1"%{$fg[magenta]%}%~%{$reset_color%}
   181     PS1=$PS1"%{$fg[magenta]%}%~%{$reset_color%}
   182 [%B%n%b:%l] %{$fg[red]%}%m%{$reset_color%}%# "
   182 [%B%n%b:%l] %{$fg[red]%}%m%{$reset_color%}%# "
   183     export PS1
   183     export PS1
   184 
   184 
   185     export _PROMPT_DEFINED="blackwhite"
   185     export _PROMPT_DEFINED="color"
   186 }
   186 }
   187 
   187 
   188 function prompt_set_dev {
   188 function prompt_set_dev {
   189     __prompt_unset_dev-vcsinfo
   189     __prompt_unset_dev-vcsinfo
   190     export _PROMPT_DEFINED="dev"
   190     export _PROMPT_DEFINED="dev"