Make zsh prompt readable on non solarized light background

This commit is contained in:
lhark 2016-07-19 00:35:22 +02:00
parent 042334b530
commit ea2e6244ac

15
zshrc
View file

@ -51,6 +51,7 @@ cd $CUR_DIR
# Configuration for virtualenv # Configuration for virtualenv
export WORKON_HOME=$HOME/.virtualenvs export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh > /dev/null 2>&1 source /usr/local/bin/virtualenvwrapper.sh > /dev/null 2>&1
source /usr/bin/virtualenvwrapper.sh > /dev/null 2>&1
# Configuration for ROS # Configuration for ROS
@ -171,7 +172,7 @@ case ${SOLARIZED_THEME:-dark} in
*) local bkg=black;; *) local bkg=black;;
esac esac
local ZSH_THEME_GIT_PROMPT_PREFIX="%{%K{${bkg}}$fg_bold[green]%}[%{$fg_bold[blue]%}" local ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[green]%}[%{$fg_bold[blue]%}"
local ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg_bold[green]%}]" local ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg_bold[green]%}]"
local ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_no_bold[green]%}✓" local ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_no_bold[green]%}✓"
local ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_no_bold[cyan]%}▴" local ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_no_bold[cyan]%}▴"
@ -180,8 +181,8 @@ local ZSH_THEME_GIT_PROMPT_STAGED="%{$fg_no_bold[green]%}●"
local ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_no_bold[yellow]%}●" local ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_no_bold[yellow]%}●"
local ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_no_bold[red]%}●" local ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_no_bold[red]%}●"
local ZSH_THEME_VIRTUALENV_PREFIX=" %{$fg_bold[green]%}(%{%b%K{${bkg}}$fg[green]%}" local ZSH_THEME_VIRTUALENV_PREFIX=" %{$fg_bold[green]%}(%{%b$fg[green]%}"
local ZSH_THEME_VIRTUALENV_SUFFIX="%{$reset_color%K{${bkg}}$fg_bold[green]%})%{$reset_color%K{${bkg}}%}" local ZSH_THEME_VIRTUALENV_SUFFIX="%{$reset_color$fg_bold[green]%})%{$reset_color%}"
# Depending if root or not, displays the right prompt char # Depending if root or not, displays the right prompt char
# and changes the color of the username # and changes the color of the username
@ -210,7 +211,7 @@ function _prompt_chars() {
local _GIT_CHAR=' ' local _GIT_CHAR=' '
fi fi
local _VENV_PROMPT="%{%K{${bkg}}%}$(virtualenv_prompt_info)" local _VENV_PROMPT="%{%}$(virtualenv_prompt_info)"
echo "$_GIT_CHAR$_VENV_PROMPT $_LIBERTY" echo "$_GIT_CHAR$_VENV_PROMPT $_LIBERTY"
} }
@ -329,7 +330,7 @@ PROMPT="%{$reset_color%}
" "
# Username, red when logged as root # Username, red when logged as root
PROMPT+="%{%K{${bkg}}%}"'$_USERNAME' PROMPT+='$_USERNAME'
# @ symbol # @ symbol
PROMPT+="%{$fg_bold[blue]%}@" PROMPT+="%{$fg_bold[blue]%}@"
@ -338,7 +339,7 @@ PROMPT+="%{$fg_bold[blue]%}@"
PROMPT+="%{$fg_bold[$couleur_hote]%}"'%m' PROMPT+="%{$fg_bold[$couleur_hote]%}"'%m'
# White space to separate host from pwd # White space to separate host from pwd
PROMPT+=" %{$reset_color%K{${bkg}}%}" PROMPT+=" %{$reset_color%}"
# Current working directory, use ~ when needed # Current working directory, use ~ when needed
PROMPT+="%{$fg[yellow]%}"'%~' PROMPT+="%{$fg[yellow]%}"'%~'
@ -348,7 +349,7 @@ PROMPT+="%{$fg_bold[green]%} %E
" "
# Prompt characters for virtualenv, git and zsh # Prompt characters for virtualenv, git and zsh
PROMPT+="%{%K{${bkg}}%}"'$(_prompt_chars)'" %{$reset_color%}" PROMPT+='$(_prompt_chars)'" %{$reset_color%}"
# Right prompt with current repo informations # Right prompt with current repo informations
RPROMPT='$(space_sh_git_prompt)'"%E%{$reset_color%}" RPROMPT='$(space_sh_git_prompt)'"%E%{$reset_color%}"