From 34e70b669e2fc1e9888e5eb605c4e05a9da5a351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin-Charles=20Guih=C3=A9neuf?= Date: Thu, 10 Sep 2026 17:20:30 +0200 Subject: [PATCH] rb --- vulporuza.zsh-theme | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/vulporuza.zsh-theme b/vulporuza.zsh-theme index 002fcb3..164e845 100644 --- a/vulporuza.zsh-theme +++ b/vulporuza.zsh-theme @@ -2,18 +2,28 @@ typeset my_gray="$FG[240]" -# Primary prompt -if [ -z "${__GIT_PROMPT_DIR}" ]; then - PS1='$my_gray${(r:$COLUMNS::-:)}%{$reset_color%} -╭ %T %{$FG[208]%}%~%{$reset_color%}$(git_prompt_info) -╰$(virtualenv_prompt_info) %(!.#.») ' +# Optional widgets: zsh-git-prompt and virtualenv plugin may be missing. +if (( $+functions[git_super_status] )); then + _vulporuza_git='$(git_super_status)' else - PS1='$my_gray${(r:$COLUMNS::-:)}%{$reset_color%} -╭ %T %{$FG[208]%}%~%{$reset_color%}$(git_super_status) -╰$(virtualenv_prompt_info) %(!.#.») ' + _vulporuza_git='$(git_prompt_info)' fi +if (( $+functions[virtualenv_prompt_info] )); then + _vulporuza_venv='$(virtualenv_prompt_info)' +else + _vulporuza_venv='' +fi + +# Primary prompt +PS1='$my_gray${(r:$COLUMNS::-:)}%{$reset_color%} +╭ %T %{$FG[208]%}%~%{$reset_color%}'$_vulporuza_git' +╰'$_vulporuza_venv' %(!.#.») ' + PS2='%{$fg[red]%}\ %{$reset_color%}' +# Cleanup +unset _vulporuza_git _vulporuza_venv + # Right prompt RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%}) $FG[245]%n@%m%{$reset_color%}' @@ -25,11 +35,7 @@ ZSH_THEME_VIRTUALENV_SUFFIX=")%{$reset_color%}" ZSH_THEME_GIT_PROMPT_PREFIX=" %{$reset_color%}[" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]" -if [ -z "${__GIT_PROMPT_DIR}" ]; then - # git settings - ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}|%{$FG[034]%}✔" - ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}|%{$FG[075]%}…" -else +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]%}" @@ -48,6 +54,9 @@ else 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}%} " +else + ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}|%{$FG[034]%}✔" + ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}|%{$FG[075]%}…" fi function theme_preexec {