]>
Commit | Line | Data |
---|---|---|
9041bd93 BB |
1 | if [ "x$OH_MY_ZSH_HG" = "x" ]; then |
2 | OH_MY_ZSH_HG="hg" | |
3 | fi | |
4 | ||
5 | function rvm_info { | |
6 | echo '('`rvm-prompt`') ' | |
7 | } | |
8 | ||
9 | function hg_prompt_info { | |
10 | $OH_MY_ZSH_HG prompt --angle-brackets "\ | |
11 | < on %{$fg[magenta]%}<branch>%{$reset_color%}>\ | |
12 | < at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\ | |
13 | %{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}< | |
14 | patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null | |
15 | } | |
16 | ||
17 | function box_name { | |
18 | [ -f ~/.box-name ] && cat ~/.box-name || hostname -s | |
19 | } | |
20 | ||
e7d66018 BB |
21 | function zle-line-init zle-keymap-select { |
22 | local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}" | |
23 | RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}${return_status}%{$reset_color%}" | |
24 | RPS2=$RPS1 | |
25 | zle reset-prompt | |
26 | } | |
27 | zle -N zle-line-init | |
28 | zle -N zle-keymap-select | |
29 | ||
9041bd93 BB |
30 | PROMPT=' |
31 | %{$fg[red]%}%n%{$reset_color%} at %{$fg[yellow]%}$(box_name)%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info) %{$fg[black]%}$(rvm_info)%{$reset_color%} | |
32 | %(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ ' | |
33 | ||
34 | ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[blue]%}" | |
35 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
36 | ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!" | |
37 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" | |
38 | ZSH_THEME_GIT_PROMPT_CLEAN="" | |
39 |