#! /usr/bin/zsh # # Prepare colors, ignoring length # C_NO="%{$reset_color%}" C_BYELLOW="%{${fg_bold[yellow]}%}" C_BRED="%{${fg_bold[red]}%}" C_BCYAN="%{${fg_bold[cyan]}%}" C_GREEN="%{${fg[green]}%}" C_MAGENTA="%{${fg_bold[magenta]}%}" # # Prompt parts # _username="${C_BYELLOW}%n${C_NO}" _machine="${C_BRED}%m${C_NO}" _hour="${C_BCYAN}[%D{%H:%M}]${C_NO}" _exitcode="%(?::${C_BRED}[ %1v ]${C_NO} )$(true)" _action="%(5v,%5v%,)" _path='${C_GREEN}%(7v,%20<..<%7v%<<${C_NO}${C_MAGENTA}@%6v%5v${C_BYELLOW}%9v${C_NO}${C_GREEN}/%15<..<%8v%<<,%25<..<%~%<<)${C_NO}' _batt='%{${fg_bold[$psvar[3]]}%}%2v%{$reset_color%} ' # # Now, the prompt itself # #PROMPT="${_exitcode}${_hour} ${_username}@${_machine}:${_vcs}${_path}$ " PROMPT="${_exitcode}${_username}@${_machine}:${_vcs}${_path}$ " RPROMPT="${_batt}"