1 function prompt_ben_precmd {
5 function virtualenv_info {
6 if [[ -z "$VIRTUAL_ENV" ]]; then
9 venv="${VIRTUAL_ENV##*/}"
15 [ -f ~/.box-name ] && cat ~/.box-name || hostname -s
18 function zle-line-init zle-keymap-select {
19 local return_status="%{%F{red}%}%(?..✘)%{$reset_color%}"
20 RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}${return_status}%{$reset_color%}"
25 zle -N zle-keymap-select
27 function prompt_ben_setup {
29 unsetopt XTRACE KSH_ARRAYS
30 prompt_opts=(cr percent subst)
32 # Load required functions.
33 autoload -Uz add-zsh-hook
35 # Add hook for calling git-info before each command.
36 add-zsh-hook precmd prompt_ben_precmd
38 # Set git-info parameters.
39 zstyle ':prezto:module:git:info' verbose 'yes'
40 zstyle ':prezto:module:git:info:branch' format '@%F{blue}%b%f'
41 zstyle ':prezto:module:git:info:clean' format ''
42 zstyle ':prezto:module:git:info:added' format '%{%F{green}%}!'
43 zstyle ':prezto:module:git:info:modified' format '%{%F{green}%}?'
44 zstyle ':prezto:module:git:info:untracked' format '%{%F{red}%}?'
45 zstyle ':prezto:module:git:info:keys' format \
50 %{%F{red}%}%n%{%f%}@%{%F{yellow}%}$(box_name)%{%f%} %{%B%F{green}%}${PWD/#$HOME/~}%{%f%b%}${git_info[prompt]} %{%F{black}%}$(virtualenv_info)%{%f%}
51 %(?,,%{${%B%F{white}%}[%?]%{%f%b%} )$ '
58 ZSH_THEME_GIT_PROMPT_PREFIX="@%{%F{blue}%}"
59 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
60 ZSH_THEME_GIT_PROMPT_DIRTY="%{%F{green}%}!"
61 ZSH_THEME_GIT_PROMPT_UNTRACKED="%{%F{green}%}?"
62 ZSH_THEME_GIT_PROMPT_CLEAN=""