4 # URL: http://andyfleming.com/
6 # dashed separator size
7 function afmagic_dashes {
8 # check either virtualenv or condaenv variables
9 local python_env="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
11 # if there is a python virtual environment and it is displayed in
12 # the prompt, account for it when returning the number of dashes
13 if [[ -n "$python_env" && "$PS1" = \(* ]]; then
14 echo $(( COLUMNS - ${#python_env} - 3 ))
20 # primary prompt: dashed separator, directory and vcs info
21 PS1="${FG[237]}\${(l.\$(afmagic_dashes)..-.)}%{$reset_color%}
22 ${FG[032]}%~\$(git_prompt_info)\$(hg_prompt_info) ${FG[105]}%(!.#.»)%{$reset_color%} "
23 PS2="%{$fg[red]%}\ %{$reset_color%}"
25 # right prompt: return code, virtualenv and context (user@host)
26 RPS1="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
27 if (( $+functions[virtualenv_prompt_info] )); then
28 RPS1+='$(virtualenv_prompt_info)'
30 RPS1+=" ${FG[237]}%n@%m%{$reset_color%}"
33 ZSH_THEME_GIT_PROMPT_PREFIX=" ${FG[075]}(${FG[078]}"
34 ZSH_THEME_GIT_PROMPT_CLEAN=""
35 ZSH_THEME_GIT_PROMPT_DIRTY="${FG[214]}*%{$reset_color%}"
36 ZSH_THEME_GIT_PROMPT_SUFFIX="${FG[075]})%{$reset_color%}"
39 ZSH_THEME_HG_PROMPT_PREFIX=" ${FG[075]}(${FG[078]}"
40 ZSH_THEME_HG_PROMPT_CLEAN=""
41 ZSH_THEME_HG_PROMPT_DIRTY="${FG[214]}*%{$reset_color%}"
42 ZSH_THEME_HG_PROMPT_SUFFIX="${FG[075]})%{$reset_color%}"
45 ZSH_THEME_VIRTUALENV_PREFIX=" ${FG[075]}["
46 ZSH_THEME_VIRTUALENV_SUFFIX="]%{$reset_color%}"