]> git.alrj.org Git - zsh.d.git/blob - S90_prompt
Slight change to git prompt
[zsh.d.git] / S90_prompt
1 #! /usr/bin/zsh
2
3 #
4 # Prepare colors, ignoring length
5 #
6 C_NO="%{$reset_color%}"
7 C_BYELLOW="%{${fg_bold[yellow]}%}"
8 C_BRED="%{${fg_bold[red]}%}"
9 C_BCYAN="%{${fg_bold[cyan]}%}"
10 C_GREEN="%{${fg[green]}%}"
11 C_BGREEN="%{${fg_bold[green]}%}"
12 C_MAGENTA="%{${fg_bold[magenta]}%}"
13
14
15
16 #
17 # Prompt parts
18 #
19 _username="${C_BYELLOW}%n${C_NO}"
20 _machine="${C_BRED}%m${C_NO}"
21 _hour="${C_BCYAN}[%D{%H:%M}]${C_NO}"
22
23 _exitcode="%(?::${C_BRED}[ %1v ]${C_NO}
24 )$(true)"
25
26
27 _action="%(5v,%5v%,)"
28 _path='${C_GREEN}%(7v,%20<..<%7v%<<${C_NO}${C_MAGENTA}@%6v%5v${__ZSH_GIT_STATUS}${C_GREEN}/%15<..<%8v%<<,%25<..<%~%<<)${C_NO}'
29
30
31 _batt='%{${fg_bold[$psvar[3]]}%}%2v%{$reset_color%} '
32
33 #
34 # Now, the prompt itself
35 #
36 #PROMPT="${_exitcode}${_hour} ${_username}@${_machine}:${_vcs}${_path}$ "
37 PROMPT="${_exitcode}${_username}@${_machine}:${_vcs}${_path}$ "
38
39 RPROMPT="${_batt}"