theme: Add color palettes

This commit is contained in:
2026-09-11 10:16:06 +02:00
parent ebb8285300
commit e354721927
3 changed files with 157 additions and 22 deletions
+31 -22
View File
@@ -1,6 +1,17 @@
# vulporuza.zsh-theme
#
# Palette: set VULPORUZA_PALETTE in ~/.zshrc before Oh My Zsh.
# Definitions: vulporuza-palettes.zsh (same directory).
typeset my_gray="$FG[240]"
typeset _vulporuza_dir="${${(%):-%x}:A:h}"
if ! source "${_vulporuza_dir}/vulporuza-palettes.zsh"; then
print -u2 "vulporuza: missing ${_vulporuza_dir}/vulporuza-palettes.zsh"
unset _vulporuza_dir
return
fi
unset _vulporuza_dir
_vulporuza_apply_palette
# Optional widgets: zsh-git-prompt and virtualenv plugin may be missing.
if (( $+functions[git_super_status] )); then
@@ -16,48 +27,46 @@ else
fi
# Primary prompt
PS1='$my_gray${(r:$COLUMNS::-:)}%{$reset_color%}
╭ %T %{$FG[208]%}%~%{$reset_color%}'$_vulporuza_git'
PS1='${_vulporuza[dash]}${(r:$COLUMNS::-:)}%{$reset_color%}
╭ %T ${_vulporuza[path]}%~%{$reset_color%}'$_vulporuza_git'
╰'$_vulporuza_venv' %(!.#.») '
PS2='%{$fg[red]%}\ %{$reset_color%}'
PS2='${_vulporuza[error]}\ %{$reset_color%}'
# Cleanup
unset _vulporuza_git _vulporuza_venv
# Right prompt
RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%}) $FG[245]%n@%m%{$reset_color%}'
RPS1='%(?..${_vulporuza[error]}%? ↵%{$reset_color%}) ${_vulporuza[host]}%n@%m%{$reset_color%}'
# Virtualenv (plugin virtualenv)
ZSH_THEME_VIRTUALENV_PREFIX=" %{$FG[075]%}("
ZSH_THEME_VIRTUALENV_PREFIX=" ${_vulporuza[venv]}("
ZSH_THEME_VIRTUALENV_SUFFIX=")%{$reset_color%}"
# Git theme
# Git: shared wrapper
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$reset_color%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]"
if (( $+functions[git_super_status] )); then
ZSH_THEME_GIT_PROMPT_HASH_PREFIX=":"
ZSH_THEME_GIT_PROMPT_SEPARATOR="|"
ZSH_THEME_GIT_PROMPT_BRANCH="%{$fg_bold[magenta]%}"
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[red]%}%{●%1G%}"
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[red]%}%{✖%1G%}"
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[blue]%}%{✚%1G%}"
ZSH_THEME_GIT_PROMPT_BRANCH="${_vulporuza[branch]}"
ZSH_THEME_GIT_PROMPT_STAGED="${_vulporuza[staged]}%{●%1G%}"
ZSH_THEME_GIT_PROMPT_CONFLICTS="${_vulporuza[conflicts]}%{✖%1G%}"
ZSH_THEME_GIT_PROMPT_CHANGED="${_vulporuza[changed]}%{✚%1G%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{↓%1G%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{↑%1G%}"
ZSH_THEME_GIT_PROMPT_STASHED="%{$fg_bold[blue]%}%{⚑%1G%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%}%{…%1G%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}%{✔%1G%}"
ZSH_THEME_GIT_PROMPT_STASHED="${_vulporuza[stashed]}%{⚑%1G%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="${_vulporuza[untracked]}%{…%1G%}"
ZSH_THEME_GIT_PROMPT_CLEAN="${_vulporuza[clean]}%{✔%1G%}"
ZSH_THEME_GIT_PROMPT_LOCAL=" L"
# The remote branch will be shown between these two
ZSH_THEME_GIT_PROMPT_UPSTREAM_FRONT=" {%{$fg[blue]%}"
ZSH_THEME_GIT_PROMPT_UPSTREAM_FRONT=" {${_vulporuza[upstream]}"
ZSH_THEME_GIT_PROMPT_UPSTREAM_END="%{${reset_color}%}}"
ZSH_THEME_GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}|MERGING%{${reset_color}%}"
ZSH_THEME_GIT_PROMPT_REBASE="%{$fg_bold[magenta]%}|REBASE%{${reset_color}%} "
ZSH_THEME_GIT_PROMPT_BISECT="%{$fg_bold[magenta]%}|BISECT%{${reset_color}%} "
ZSH_THEME_GIT_PROMPT_MERGING="${_vulporuza[state]}|MERGING%{${reset_color}%}"
ZSH_THEME_GIT_PROMPT_REBASE="${_vulporuza[state]}|REBASE%{${reset_color}%} "
ZSH_THEME_GIT_PROMPT_BISECT="${_vulporuza[state]}|BISECT%{${reset_color}%} "
else
ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}|%{$FG[034]%}✔"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}|%{$FG[075]%}…"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}|${_vulporuza[clean]}✔"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}|${_vulporuza[dirty]}…"
fi
function theme_preexec {