diff --git a/brethil_dotfile.sh b/brethil_dotfile.sh index 23d061b..6e99a43 100755 --- a/brethil_dotfile.sh +++ b/brethil_dotfile.sh @@ -3,7 +3,6 @@ export LANG=en_US.UTF-8 # theme-related variables export ZSH_CUSTOM="$DOTFILES" -export ZSH_THEME="brethil" export DISABLE_UNTRACKED_FILES_DIRTY=true export VIRTUAL_ENV_DISABLE_PROMPT=true diff --git a/themes/brethil-minimal.zsh-theme b/themes/brethil-minimal.zsh-theme index ab1d585..5a12f60 100644 --- a/themes/brethil-minimal.zsh-theme +++ b/themes/brethil-minimal.zsh-theme @@ -6,5 +6,5 @@ PROMPT='[%{$fg[red]%}${user}%M%{$reset_color%}][:%{$fg[green]%}%c%{$reset_color% ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}git:(" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%})%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[white]%} %{$fg[red]%}✗%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%} %{$fg[green]%}√%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}✗%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}√%{$reset_color%}" diff --git a/themes/brethil.zsh-theme b/themes/brethil.zsh-theme index a424ff6..c92f4bb 100644 --- a/themes/brethil.zsh-theme +++ b/themes/brethil.zsh-theme @@ -3,8 +3,6 @@ # See "EXPANSION OF PROMPT SEQUENCES" in `man zshmisc` # Note: Most of the expansions/color sequences can be tested using `print -P` - # prints hostname on an orange background if on an ssh connection, adds username if root - local user='%(!.%K{160}%F{255}%B%n%b%k%f.)' # prints 'root' on a red background if user is root local host='%K{202}%B%F{255}%m%f%k%b' # bold host name on an orange background local open_bracket='%(!.[.)' @@ -35,8 +33,8 @@ local path_prompt='[%F{green}%(4~:…/%3~:%~)%f]' ZSH_THEME_GIT_PROMPT_PREFIX=" %f%{$fg[yellow]%} " ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} |" -ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[white]%}%{$fg[red]%}x%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[white]%}%{$fg[green]%}√%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}x%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}√%{$reset_color%}" # The following are part of `git_prompt_status` # Rules: @@ -59,7 +57,7 @@ ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="<>" local BOLD_PURPLE='%B%F{5}' local CLEAR='%f%b' local venv -function virtualenv_info { +function __virtualenv_info { [ -z "$VIRTUAL_ENV" ] && return venv="$(basename "$VIRTUAL_ENV")" if [[ "$venv" == ".venv" ]]; then @@ -77,9 +75,9 @@ local return_code_RPS1='%(?..%B%F{88}-$?-%f%b)' local success="%B%F{28} →%f%b" local failure="%B%{$fg[red]%} x%b%{$reset_color%}" -local prompt_with_previous_return_status="%(?:$success:$failure) " +local prompt_with_previous_return_status="%(?:$success:$failure)" -function prompt_too_long(){ +function __prompt_too_long(){ # prints a newline if less than $COLUMNS/2 characters remain to the right margin, see end of `man zshmisc` echo "%-$((COLUMNS/2))(l..\n)" } @@ -89,7 +87,7 @@ export MODE_INDICATOR="[%B%K{red}nav%k%b]" # red background export INSERT_MODE_INDICATOR="[%B%K{28}ins%k%b]" # green background # put it all together -PROMPT='$(virtualenv_info)'"${user_prompt}${path_prompt}${git_prompt}${job_prompt}${shlvl_prompt}$(prompt_too_long)${prompt_with_previous_return_status}" +PROMPT='$(__virtualenv_info)'"${user_prompt}${path_prompt}${git_prompt}${job_prompt}${shlvl_prompt}$(__prompt_too_long)${prompt_with_previous_return_status}" # Right prompt is just return code and time RPS1="${return_code_RPS1}"'$(vi_mode_prompt_info)[%*]'