1 # prompt style and colors based on Steve Losh's Prose theme:
2 # https://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
4 # vcs_info modifications from Bart Trojanowski's zsh prompt:
5 # http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
7 # git untracked files modification from Brian Carper:
8 # https://briancarper.net/blog/570/git-info-in-your-zsh-prompt
10 export VIRTUAL_ENV_DISABLE_PROMPT=1
12 function virtualenv_info {
13 [ $VIRTUAL_ENV ] && echo '('%F{blue}`basename $VIRTUAL_ENV`%f') '
19 autoload -U add-zsh-hook
22 #use extended color palette if available
23 if [[ $terminfo[colors] -ge 256 ]]; then
37 # enable VCS systems you use
38 zstyle ':vcs_info:*' enable git svn
40 # check-for-changes can be really slow.
41 # you should disable it, if you work with large repositories
42 zstyle ':vcs_info:*:prompt:*' check-for-changes true
46 # %u - unstagedstr (see below)
47 # %c - stagedstr (see below)
48 # %a - action (e.g. rebase-i)
49 # %R - repository path
50 # %S - path in the repository
52 FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
53 FMT_ACTION="(%{$limegreen%}%a${PR_RST})"
54 FMT_UNSTAGED="%{$orange%}●"
55 FMT_STAGED="%{$limegreen%}●"
57 zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}"
58 zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}"
59 zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}"
60 zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}"
61 zstyle ':vcs_info:*:prompt:*' nvcsformats ""
64 function steeef_preexec {
77 add-zsh-hook preexec steeef_preexec
79 function steeef_chpwd {
82 add-zsh-hook chpwd steeef_chpwd
84 function steeef_precmd {
85 if [[ -n "$PR_GIT_UPDATE" ]] ; then
86 # check for untracked files or updated submodules, since vcs_info doesn't
87 if git ls-files --other --exclude-standard 2> /dev/null | grep -q "."; then
89 FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})"
91 FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
93 zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH} "
99 add-zsh-hook precmd steeef_precmd
102 %{$purple%}%n${PR_RST} at %{$orange%}%m${PR_RST} in %{$limegreen%}%~${PR_RST} $vcs_info_msg_0_$(virtualenv_info)