1 autoload
-Uz promptinit
&& promptinit
3 if [[ "$TERM" == (dumb
|linux
|*bsd
*) ]] || (( $#prompt_argv < 1 )); then
11 function prompt_precmd
{
19 function virtualenv_info
{
20 if [[ -z "$VIRTUAL_ENV" ]]; then
23 venv
="${VIRTUAL_ENV##*/}"
29 if [[ -z "$RUBY_VERSION" ]]; then
38 if [[ -z "$NVM_BIN" ]]; then
47 [ -f ~
/.box
-name ] && cat ~
/.box
-name || hostname
-s
54 function zle
-line-init zle
-keymap-select {
56 # Couldn't figure out how to get tmux and iTerm to agree on how to render
57 # these characters... so there you go.
59 local normal_symbol
="🅽"
60 local insert_symbol
="🅸"
61 local error_symbol
="🆇"
63 [ ! -z "$TMUX" ] && normal_symbol
="%{$normal_symbol%2G%}"
64 [ ! -z "$TMUX" ] && insert_symbol
="%{$insert_symbol%2G%}"
65 [ ! -z "$TMUX" ] && error_symbol
="%{$error_symbol%2G%}"
67 # Show vi status / return status on the right side
69 local return_status
="%{%F{red}%}%(?.. $error_symbol)%{$reset_color%}"
70 if [ $KEYMAP = 'vicmd' ]; then
71 local edit_status
="%{%F{cyan}%}$normal_symbol"
73 local edit_status
="%{%F{green}%}$insert_symbol"
76 RPROMPT
="${edit_status}${return_status}%{$reset_color%}"
80 zle
-N zle
-keymap-select
86 function prompt_setup
{
88 unsetopt XTRACE KSH_ARRAYS
89 prompt_opts
=(cr percent subst
)
91 # Load required functions.
92 autoload
-Uz add
-zsh-hook
94 # Add hook for calling git-info before each command.
95 add
-zsh-hook precmd prompt_precmd
97 # Set git-info parameters.
98 zstyle
':git:info' verbose
'no'
99 zstyle
':git:info:branch' format
'@%F{cyan}%b%f'
100 zstyle
':git:info:clean' format
''
101 zstyle
':git:info:added' format
'%{%F{green}%}!'
102 zstyle
':git:info:modified' format
'%{%F{green}%}?'
103 zstyle
':git:info:untracked' format
'%{%F{magenta}%}?'
104 zstyle
':git:info:keys' format \
109 %{%F{black}%}$(nvm_info) $(rvm_info) $(virtualenv_info)
110 %{%F{magenta}%}%n%{%f%}@%{%F{yellow}%}$(box_name)%{%f%} %{%B%F{green}%}${PWD/#$HOME/~}%{%f%b%}${git_info[prompt]} %{%f%}
111 %(?,,%{${%B%F{white}%}[%?]%{%f%b%} )$ '
116 setopt PROMPT_PERCENT
117 setopt TRANSIENT_RPROMPT