diff options
author | Hendrik Jaeger <henk@frustcomp> | 2014-11-11 00:42:55 +0100 |
---|---|---|
committer | Hendrik Jaeger <henk@frustcomp> | 2014-11-11 00:42:55 +0100 |
commit | bacbcecaa0bce6e2286cb1c031131149b7130a46 (patch) | |
tree | d6928469d467e765981d31a9e0dad424914d13ff /.zsh_functions | |
parent | c6f847b4678c616bd09ebfcf3980ffbabef10caf (diff) |
Added vcs_info to prompt
modified: .zsh_functions
modified: .zshrc
Diffstat (limited to '.zsh_functions')
-rw-r--r-- | .zsh_functions | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/.zsh_functions b/.zsh_functions index d4818ec..858e7c5 100644 --- a/.zsh_functions +++ b/.zsh_functions @@ -17,27 +17,35 @@ function ESC_print () { } preexec () { - if [[ "$TERM" == screen* ]] ; then - local CMD=${1[(wr)^(*=*|sudo|ssh|evince|-*)]} - ESC_print ${CMD} - fi - case $TERM in - (xterm*|rxvt*) - set_title "${(%):-"%n@%m:"}" "$1" - ;; - esac + case $TERM in + (xterm*|rxvt*) + set_title "${(%):-"%n@%m:"}" "$1" + ;; + (screen*) + local CMD=${1[(wr)^(*=*|sudo|ssh|evince|-*)]} + ESC_print ${CMD} + ;; + esac } precmd () { - if [[ $TERM == screen* ]] ; then - ESC_print "zsh" - fi - - case $TERM in - (xterm*|rxvt*) - set_title ${(%):-"%n@%m: %~"} - ;; - esac + case $TERM in + (xterm*|rxvt*) + set_title ${(%):-"%n@%m: %~"} + ;; + (screen*) + ESC_print "zsh" + ;; + esac + + vcs_info + if [[ -n ${vcs_info_msg_0_} ]]; then + local HENKSPROMPT="%(0?..%F{red}E%?%f )%(1j.%F{yellow}J%j%f .)%(3L.%F{yellow}L%L%f .)%3~ %F{green}$VCSH_REPO_NAME%f%F{yellow}${vcs_info_msg_0_}%f%# " + PS1="$HENKSPROMPTHEADER$HENKSPROMPT" + else + local HENKSPROMPT="%(0?..%F{red}E%?%f )%(1j.%F{yellow}J%j%f .)%(3L.%F{yellow}L%L%f .)%3~ %F{green}$VCSH_REPO_NAME%f%F{yellow}${vcs_info_msg_0_}%f%# " + PS1="$HENKSPROMPTHEADER$HENKSPROMPT" + fi } function vifind () { |