From 17f4cfca99398cb5511557b8515a17bf1bf2948a Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 13 Jul 2019 12:48:10 +0200 Subject: af-magic: make separator window-size-aware (#7739) --- themes/af-magic.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes/af-magic.zsh-theme') diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 1c6d1732c..2a6595a71 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -6,7 +6,7 @@ if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" # primary prompt -PROMPT='$FG[237]------------------------------------------------------------%{$reset_color%} +PROMPT='$FG[237]${(l.COLUMNS..-.)}%{$reset_color%} $FG[032]%~\ $(git_prompt_info) \ $FG[105]%(!.#.»)%{$reset_color%} ' -- cgit v1.2.3-70-g09d2 From 43ed0b455ed5bbf66ef3e604c3d9845eb90f0078 Mon Sep 17 00:00:00 2001 From: Matthew Armand Date: Mon, 19 Aug 2019 12:54:49 -0400 Subject: af-magic: add hg prompt and tweak virtualenv info (#8056) - Add mercurial support to af-magic, so now the vcs prompt will show up in either a git or hg repository - The virtualenv prompt was white and bumped up against the user@hostname output - Fixed that so its green (which I thought highlighted it more thematically) and has a space before user@hostname --- themes/af-magic.zsh-theme | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'themes/af-magic.zsh-theme') diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 2a6595a71..d185fa1ab 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -8,7 +8,7 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" # primary prompt PROMPT='$FG[237]${(l.COLUMNS..-.)}%{$reset_color%} $FG[032]%~\ -$(git_prompt_info) \ +$(git_prompt_info)$(hg_prompt_info) \ $FG[105]%(!.#.»)%{$reset_color%} ' PROMPT2='%{$fg[red]%}\ %{$reset_color%}' RPS1='${return_code}' @@ -21,7 +21,7 @@ eval my_orange='$FG[214]' # right prompt if type "virtualenv_prompt_info" > /dev/null then - RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%' + RPROMPT='$FG[078]$(virtualenv_prompt_info)%{$reset_color%} $my_gray%n@%m%{$reset_color%}%' else RPROMPT='$my_gray%n@%m%{$reset_color%}%' fi @@ -31,3 +31,9 @@ ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075]($FG[078]" ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}" ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}" + +# hg settings +ZSH_THEME_HG_PROMPT_PREFIX="$FG[075]($FG[078]" +ZSH_THEME_HG_PROMPT_CLEAN="" +ZSH_THEME_HG_PROMPT_DIRTY="$my_orange*%{$reset_color%}" +ZSH_THEME_HG_PROMPT_SUFFIX="$FG[075])%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From 6bebc254e88ac9b7fdaa7491d031f82ec107e418 Mon Sep 17 00:00:00 2001 From: Aliaksei Maiseyeu Date: Tue, 4 Feb 2020 15:27:18 +0300 Subject: af-magic: fix showing aws prompt out of the box (#8243) Fix issue related to #7615, #7747 and #6346 After the update, aws prompt (which should be visible out of the box) disappears when a user uses a theme af-magic, because of fact that plugins are loaded before themes. This pull request fixes issue with not showing aws prompt in theme af-magic, by appending RPROMPT in theme af-magic instead overwriting. --- themes/af-magic.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'themes/af-magic.zsh-theme') diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index d185fa1ab..30e997f8c 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -21,9 +21,9 @@ eval my_orange='$FG[214]' # right prompt if type "virtualenv_prompt_info" > /dev/null then - RPROMPT='$FG[078]$(virtualenv_prompt_info)%{$reset_color%} $my_gray%n@%m%{$reset_color%}%' + RPROMPT="${RPROMPT}"'$FG[078]$(virtualenv_prompt_info)%{$reset_color%} $my_gray%n@%m%{$reset_color%}%' else - RPROMPT='$my_gray%n@%m%{$reset_color%}%' + RPROMPT="${RPROMPT}"'$my_gray%n@%m%{$reset_color%}%' fi # git settings -- cgit v1.2.3-70-g09d2 From d49397a01d0cc704008d6f1089ef6a7270d17116 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 18 Feb 2020 19:14:30 +0100 Subject: af-magic: fix dashed separator sizing and refactor Fixes #8081 --- themes/af-magic.zsh-theme | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'themes/af-magic.zsh-theme') diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 30e997f8c..4d1a40947 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -2,29 +2,28 @@ # Repo: https://github.com/andyfleming/oh-my-zsh # Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" -# primary prompt -PROMPT='$FG[237]${(l.COLUMNS..-.)}%{$reset_color%} -$FG[032]%~\ -$(git_prompt_info)$(hg_prompt_info) \ -$FG[105]%(!.#.»)%{$reset_color%} ' -PROMPT2='%{$fg[red]%}\ %{$reset_color%}' -RPS1='${return_code}' +# settings +typeset +H return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" +typeset +H my_gray="$FG[237]" +typeset +H my_orange="$FG[214]" +# separator dashes size +function afmagic_dashes { + [[ -n "${VIRTUAL_ENV-}" && -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" && "$PS1" = \(* ]] \ + && echo $(( COLUMNS - ${#VIRTUAL_ENV} - 3 )) \ + || echo $COLUMNS +} -# color vars -eval my_gray='$FG[237]' -eval my_orange='$FG[214]' +# primary prompt +PS1='$FG[237]${(l.$(afmagic_dashes)..-.)}%{$reset_color%} +$FG[032]%~$(git_prompt_info)$(hg_prompt_info) $FG[105]%(!.#.»)%{$reset_color%} ' +PS2='%{$fg[red]%}\ %{$reset_color%}' +RPS1='${return_code}' # right prompt -if type "virtualenv_prompt_info" > /dev/null -then - RPROMPT="${RPROMPT}"'$FG[078]$(virtualenv_prompt_info)%{$reset_color%} $my_gray%n@%m%{$reset_color%}%' -else - RPROMPT="${RPROMPT}"'$my_gray%n@%m%{$reset_color%}%' -fi +(( $+functions[virtualenv_prompt_info] )) && RPS1+='$(virtualenv_prompt_info)' +RPS1+=' $my_gray%n@%m%{$reset_color%}%' # git settings ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075]($FG[078]" @@ -37,3 +36,7 @@ ZSH_THEME_HG_PROMPT_PREFIX="$FG[075]($FG[078]" ZSH_THEME_HG_PROMPT_CLEAN="" ZSH_THEME_HG_PROMPT_DIRTY="$my_orange*%{$reset_color%}" ZSH_THEME_HG_PROMPT_SUFFIX="$FG[075])%{$reset_color%}" + +# virtualenv settings +ZSH_THEME_VIRTUALENV_PREFIX=" $FG[075][" +ZSH_THEME_VIRTUALENV_PREFIX="]%{$reset_color%}" -- cgit v1.2.3-70-g09d2 From de261bd29cb5920b9ad37e67fe5e29ae3c348cfd Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 18 Feb 2020 22:28:58 +0100 Subject: af-magic: fix virtualenv prompt suffix --- themes/af-magic.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes/af-magic.zsh-theme') diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 4d1a40947..148991fec 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -39,4 +39,4 @@ ZSH_THEME_HG_PROMPT_SUFFIX="$FG[075])%{$reset_color%}" # virtualenv settings ZSH_THEME_VIRTUALENV_PREFIX=" $FG[075][" -ZSH_THEME_VIRTUALENV_PREFIX="]%{$reset_color%}" +ZSH_THEME_VIRTUALENV_SUFFIX="]%{$reset_color%}" -- cgit v1.2.3-70-g09d2