Mercurial > dotfiles
changeset 179:ebbbf3567a0e
zsh prompt: detabify
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Wed, 13 Jan 2010 10:34:12 -0600 |
parents | da329720ff18 |
children | cd4e645d1207 |
files | .shell.d/99.prompt.zsh |
diffstat | 1 files changed, 19 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/.shell.d/99.prompt.zsh +++ b/.shell.d/99.prompt.zsh @@ -6,16 +6,16 @@ setopt prompt_subst preexec () { - currJob="`echo $3 | cut -d ' ' -f 1 | head -n 1`" - if [[ "$TERM" == "screen" ]]; then - hostUser="%10<...<%~%<<" - print -Pn "\ek[$hostUser $currJob]\e\\" - else - if [[ "$FANCYTYPE" == "YES" ]]; then - hostUser="%n@%m: %2~" - print -Pn "\e]0;$hostUser [$currJob]\a" - fi - fi + currJob="`echo $3 | cut -d ' ' -f 1 | head -n 1`" + if [[ "$TERM" == "screen" ]]; then + hostUser="%10<...<%~%<<" + print -Pn "\ek[$hostUser $currJob]\e\\" + else + if [[ "$FANCYTYPE" == "YES" ]]; then + hostUser="%n@%m: %2~" + print -Pn "\e]0;$hostUser [$currJob]\a" + fi + fi } function right_side_prompt() { @@ -32,16 +32,16 @@ function precmd () { } if [ "x`whoami`" = "xroot" ] ; then - PS1=$'%{\e];%n@%m: %2~ [zsh]\a%}[%m:%3~] %{\e[31m%}%n%{\e[0m%}%# ' - if [[ "$TERM" == "screen" ]] ; then - PS1=$'%{\ek[%2~ zsh]\e\\%}[%m:%3~] %{\e[31m%}%n%{\e[0m%}%# ' - fi - RPS1=$'%{\e[1;35m%}[DANGER %t]%{\e[0m%}%(?..%{\e[1;33m%} %?%{\e[1;0m%})' + PS1=$'%{\e];%n@%m: %2~ [zsh]\a%}[%m:%3~] %{\e[31m%}%n%{\e[0m%}%# ' + if [[ "$TERM" == "screen" ]] ; then + PS1=$'%{\ek[%2~ zsh]\e\\%}[%m:%3~] %{\e[31m%}%n%{\e[0m%}%# ' + fi + RPS1=$'%{\e[1;35m%}[DANGER %t]%{\e[0m%}%(?..%{\e[1;33m%} %?%{\e[1;0m%})' else - PS1=$'%{\e];%n@%m: %2~ [zsh]\a%}[%m:%3~] %{\e[34m%}%n%{\e[0m%}%# ' - if [[ "$TERM" == "screen" ]]; then - PS1=$'%{\ek[%2~ zsh]\e\\%}[%m:%3~] %{\e[34m%}%n%{\e[0m%}%# ' - fi + PS1=$'%{\e];%n@%m: %2~ [zsh]\a%}[%m:%3~] %{\e[34m%}%n%{\e[0m%}%# ' + if [[ "$TERM" == "screen" ]]; then + PS1=$'%{\ek[%2~ zsh]\e\\%}[%m:%3~] %{\e[34m%}%n%{\e[0m%}%# ' + fi RPS1=$'[$rps_branch]%(?..%{\e[1;33m%} %?%{\e[0m%})' fi