]> git.alrj.org Git - zsh.d.git/blob - S90_prompt
Correct Konsole tab renaming
[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_MAGENTA="%{${fg_bold[magenta]}%}"
12
13
14
15 #
16 # Prompt parts
17 #
18 _username="${C_BYELLOW}%n${C_NO}"
19 _machine="${C_BRED}%m${C_NO}"
20 _hour="${C_BCYAN}[%D{%H:%M}]${C_NO}"
21
22 _exitcode="%(?::${C_BRED}[ %1v ]${C_NO}
23 )$(true)"
24
25 _action="%(5v,%5v%,)"
26 _path='${C_GREEN}%(7v,%20<..<%7v%<<${C_NO}${C_MAGENTA}@%6v%5v${C_BYELLOW}%9v${C_NO}${C_GREEN}/%15<..<%8v%<<,%25<..<%~%<<)${C_NO}'
27
28
29 _batt='%{${fg_bold[$psvar[3]]}%}%2v%{$reset_color%} '
30
31 #
32 # Now, the prompt itself
33 #
34 #PROMPT="${_exitcode}${_hour} ${_username}@${_machine}:${_vcs}${_path}$ "
35 PROMPT="${_exitcode}${_username}@${_machine}:${_vcs}${_path}$ "
36
37 RPROMPT="${_batt}"