SHARE
TWEET

Untitled

a guest Jul 9th, 2012 138 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Charge les couleurs
  2. autoload -U colors
  3. colors
  4.  
  5. autoload -Uz vcs_info
  6. vcs_info
  7.  
  8. # On redéfini le format
  9. zstyle ':vcs_info:*' actionformats \
  10.     "${MA}[${RED}%a${MA}] ${NC}" \
  11.     "${MA}(${GR}%s${MA})${NC}"
  12.  
  13. zstyle ':vcs_info:*' formats \
  14.     "${MA}[${GR}%b${MA}] ${NC}" \
  15.     "${MA}(${GR}%s${MA})${NC}"
  16.  
  17. zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "%b${RED}:${YE}%r"
  18.  
  19. autoload -Uz compinit
  20. compinit
  21.  
  22. #autoload zkbd
  23.  
  24. autoload -U tetris
  25. zle -N tetris
  26. #bindkey £ tetris
  27.  
  28. zmodload zsh/complist
  29.  
  30. # Permet d'utiliser des variables en prompt
  31. setopt PROMPT_SUBST
  32.  
  33. precmd () {
  34.    vcs_info
  35.    local loadvalue=$(awk '{print $1}' /proc/loadavg)
  36.    local load=${loadvalue/[.,]/}
  37.    if [ ${load} -lt 70 ] ; then
  38.       LOADAVG="%{$fg[grey]%}$loadvalue%{$reset_color%} "
  39.    elif [ ${load} -ge 70 ] && [ ${load} -lt 120 ] ; then
  40.       LOADAVG="%{$fg[green]%}$loadvalue%{$reset_color%} "
  41.    elif [ ${load} -ge 120 ] && [ ${load} -lt 200 ] ; then
  42.       LOADAVG="%{$fg[yellow]%}$loadvalue%{$reset_color%} "
  43.    elif [ ${load} -ge 200 ] && [ ${load} -lt 300 ] ; then
  44.       LOADAVG="%{$fg[red]%}$loadvalue%{$reset_color%} "
  45.    else
  46.       LOADAVG="%{$fg[white]%}$loadvalue%{$reset_color%} "
  47.    fi
  48. }
  49.  
  50. #########################
  51. ## Définition du prompt #
  52. #########################
  53. export PROMPT="${LOADAVG}%{$fg[red]%}%n%{$reset_color%}@%m "\
  54. "%B%(!.%{$fg[yellow]%}%~%b%{$reset_color%}.%{$fg[blue]%}%~%b%{$reset_color%}) "\
  55. "%(j..%j )%{$fg[green]%}${vcs_info_msg_1_}%{$reset_color%}%f%(?.. [%?])%# "
  56. #export PROMPT='%{$fg[red]%}%n%{$reset_color%}@%M:%B%{$fg[blue]%}%~%b%{$reset_color%} ${vcs_info_msg_0_}%f%(?.. [%?])%# '
  57. export RPROMPT="[%{$fg[green]%}%*%{$reset_color%}]"
  58. export PS2='>'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top