# Original theme https://github.com/agnoster zsh theme # Replaced the symbol characters in prompt to work properly with powerline fonts ZSH_THEME_GIT_PROMPT_DIRTY='±' function _git_prompt_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" echo "${ref/refs\/heads\// }$(parse_git_dirty)" } function _git_info() { if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then local BG_COLOR=green if [[ -n $(parse_git_dirty) ]]; then BG_COLOR=yellow FG_COLOR=black fi if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then BG_COLOR=red FG_COLOR=white fi echo "%{%K{$BG_COLOR}%}%{%F{$FG_COLOR}%} $(_git_prompt_info) %{%F{$BG_COLOR}%K{blue}%}" else echo "%{%K{blue}%}" fi } function virtualenv_info { [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' } PROMPT_HOST='%{%b%F{gray}%K{black}%} %(?.%{%F{green}%}✔.%{%F{red}%}✘)%{%F{yellow}%} %n %{%F{black}%}' # %c or %. outputs the current directory only. '\ ' to give extra space after directory name # Coding the color back to white again was necessary PROMPT_DIR=%{$fg[white]%}\ %c\ %{$reset_color%} PROMPT_SU='%(!.%{%k%F{blue}%K{black}%}%{%F{yellow}%} ⚡ %{%k%F{black}%}.%{%k%F{blue}%})%{%f%k%b%}' PROMPT='%{%f%b%k%}$PROMPT_HOST$(_git_info)$PROMPT_DIR$PROMPT_SU $(virtualenv_info)❯ ' RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}' # LS colors match Solarized Dark Theme: http://ethanschoonover.com/solarized # LS colors, made with http://geoff.greer.fm/lscolors/ export LSCOLORS="exfxcxdxbxegedabagacad" export LS_COLORS='di=34;40:ln=35:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:'