Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Charge les couleurs
- autoload -U colors
- colors
- autoload -Uz vcs_info
- vcs_info
- # On redéfini le format
- zstyle ':vcs_info:*' actionformats \
- "${MA}[${RED}%a${MA}] ${NC}" \
- "${MA}(${GR}%s${MA})${NC}"
- zstyle ':vcs_info:*' formats \
- "${MA}[${GR}%b${MA}] ${NC}" \
- "${MA}(${GR}%s${MA})${NC}"
- zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "%b${RED}:${YE}%r"
- autoload -Uz compinit
- compinit
- #autoload zkbd
- autoload -U tetris
- zle -N tetris
- #bindkey £ tetris
- zmodload zsh/complist
- # Permet d'utiliser des variables en prompt
- setopt PROMPT_SUBST
- precmd () {
- vcs_info
- local loadvalue=$(awk '{print $1}' /proc/loadavg)
- local load=${loadvalue/[.,]/}
- if [ ${load} -lt 70 ] ; then
- LOADAVG="%{$fg[grey]%}$loadvalue%{$reset_color%} "
- elif [ ${load} -ge 70 ] && [ ${load} -lt 120 ] ; then
- LOADAVG="%{$fg[green]%}$loadvalue%{$reset_color%} "
- elif [ ${load} -ge 120 ] && [ ${load} -lt 200 ] ; then
- LOADAVG="%{$fg[yellow]%}$loadvalue%{$reset_color%} "
- elif [ ${load} -ge 200 ] && [ ${load} -lt 300 ] ; then
- LOADAVG="%{$fg[red]%}$loadvalue%{$reset_color%} "
- else
- LOADAVG="%{$fg[white]%}$loadvalue%{$reset_color%} "
- fi
- }
- #########################
- ## Définition du prompt #
- #########################
- export PROMPT="${LOADAVG}%{$fg[red]%}%n%{$reset_color%}@%m "\
- "%B%(!.%{$fg[yellow]%}%~%b%{$reset_color%}.%{$fg[blue]%}%~%b%{$reset_color%}) "\
- "%(j..%j )%{$fg[green]%}${vcs_info_msg_1_}%{$reset_color%}%f%(?.. [%?])%# "
- #export PROMPT='%{$fg[red]%}%n%{$reset_color%}@%M:%B%{$fg[blue]%}%~%b%{$reset_color%} ${vcs_info_msg_0_}%f%(?.. [%?])%# '
- export RPROMPT="[%{$fg[green]%}%*%{$reset_color%}]"
- export PS2='>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement