Mon ZSHRC qui me permet d’ajouter un peu de couleur et surtout d’avoir un moyen visuel pour indiquer si l’utilisateur courant est root ou pas.
autoload -U compinit promptinit colors
compinit
#promptinit
colors
# Les alias marchent comme sous bash
alias ls='ls --color=auto'
export GREP_COLOR=31
alias grep='grep --color=auto'
export EDITOR=/usr/bin/vim
if [ $(whoami) = "root" ]
then
export PS1="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%d %{$reset_color%}%{$fg[green]%}(%T)%{$reset_color%} %{$fg[red]%}# %{$reset_color%}"
else
export PS1="%{$fg[green]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%d %{$reset_color%}%{$fg[green]%}(%T)%{$reset_color%} %{$fg[green]%}%% %{$reset_color%}"
fi
# number of lines kept in history
export HISTSIZE=1000
# number of lines saved in the history after logout
export SAVEHIST=1000
# location of history
export HISTFILE=~/.zhistory
# append command to history file once executed
setopt inc_append_history