1 function prompt_ben_precmd {
5 function virtualenv_info {
6 if [[ -z "$VIRTUAL_ENV" ]]; then
9 venv="${VIRTUAL_ENV##*/}"
15 if [[ -z "$RUBY_VERSION" ]]; then
24 if [[ -z "$NVM_BIN" ]]; then
33 [ -f ~/.box-name ] && cat ~/.box-name || hostname -s
36 function zle-line-init zle-keymap-select {
37 local return_status="%{%F{red}%}%(?..✘)%{$reset_color%}"
38 RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}${return_status}%{$reset_color%}"
43 zle -N zle-keymap-select
45 function prompt_ben_setup {
47 unsetopt XTRACE KSH_ARRAYS
48 prompt_opts=(cr percent subst)
50 # Load required functions.
51 autoload -Uz add-zsh-hook
53 # Add hook for calling git-info before each command.
54 add-zsh-hook precmd prompt_ben_precmd
56 # Set git-info parameters.
57 zstyle ':prezto:module:git:info' verbose 'yes'
58 zstyle ':prezto:module:git:info:branch' format '@%F{blue}%b%f'
59 zstyle ':prezto:module:git:info:clean' format ''
60 zstyle ':prezto:module:git:info:added' format '%{%F{green}%}!'
61 zstyle ':prezto:module:git:info:modified' format '%{%F{green}%}?'
62 zstyle ':prezto:module:git:info:untracked' format '%{%F{red}%}?'
63 zstyle ':prezto:module:git:info:keys' format \
68 %{%F{black}%}$(nvm_info) $(rvm_info) $(virtualenv_info)
69 %{%F{red}%}%n%{%f%}@%{%F{yellow}%}$(box_name)%{%f%} %{%B%F{green}%}${PWD/#$HOME/~}%{%f%b%}${git_info[prompt]} %{%f%}
70 %(?,,%{${%B%F{white}%}[%?]%{%f%b%} )$ '
77 ZSH_THEME_GIT_PROMPT_PREFIX="@%{%F{blue}%}"
78 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
79 ZSH_THEME_GIT_PROMPT_DIRTY="%{%F{green}%}!"
80 ZSH_THEME_GIT_PROMPT_UNTRACKED="%{%F{green}%}?"
81 ZSH_THEME_GIT_PROMPT_CLEAN=""