summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2022-04-02 13:24:35 -0500
committerTuowen Zhao <ztuowen@gmail.com>2022-04-02 13:24:35 -0500
commit2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945 (patch)
tree99add95300f57806b89bd885a5f5322ce9f9ac1a /themes
parentcae9a2b797649379e865e6bd73bc67e294e4ac77 (diff)
parent53863e7b3ff0c2e2816e90dab3d870adebdf49c7 (diff)
downloadzsh-2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945.tar.gz
zsh-2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945.tar.bz2
zsh-2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'themes')
-rw-r--r--themes/apple.zsh-theme18
-rw-r--r--themes/gentoo.zsh-theme4
-rw-r--r--themes/jnrowe.zsh-theme1
-rw-r--r--themes/kolo.zsh-theme16
-rw-r--r--themes/linuxonly.zsh-theme1
-rw-r--r--themes/michelebologna.zsh-theme38
-rw-r--r--themes/trapd00r.zsh-theme1
-rw-r--r--themes/zhann.zsh-theme16
8 files changed, 49 insertions, 46 deletions
diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme
index 95e6249fa..0c183258e 100644
--- a/themes/apple.zsh-theme
+++ b/themes/apple.zsh-theme
@@ -2,27 +2,23 @@ function toon {
echo -n ""
}
-get_git_dirty() {
- git diff --quiet || echo '*'
-}
-
autoload -Uz vcs_info
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes
-zstyle ':vcs_info:*' actionformats \
- '%F{5}%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f '
-zstyle ':vcs_info:*' formats \
- '%F{5}%F{5}[%F{2}%b%c%u%F{5}]%f '
-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
+zstyle ':vcs_info:*' actionformats '%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f '
+zstyle ':vcs_info:*' formats '%F{5}[%F{2}%b%c%u%F{5}]%f '
+zstyle ':vcs_info:svn:*' branchformat '%b'
+zstyle ':vcs_info:svn:*' actionformats '%F{5}[%F{2}%b%F{1}:%F{3}%i%F{3}|%F{1}%a%c%u%F{5}]%f '
+zstyle ':vcs_info:svn:*' formats '%F{5}[%F{2}%b%F{1}:%F{3}%i%c%u%F{5}]%f '
zstyle ':vcs_info:*' enable git cvs svn
theme_precmd () {
- vcs_info
+ vcs_info
}
setopt prompt_subst
PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
autoload -U add-zsh-hook
-add-zsh-hook precmd theme_precmd \ No newline at end of file
+add-zsh-hook precmd theme_precmd
diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme
index 7ac461036..b1aef21df 100644
--- a/themes/gentoo.zsh-theme
+++ b/themes/gentoo.zsh-theme
@@ -6,7 +6,9 @@ zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unst
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes
zstyle ':vcs_info:*' actionformats '%F{5}(%F{2}%b%F{3}|%F{1}%a%c%u%m%F{5})%f '
zstyle ':vcs_info:*' formats '%F{5}(%F{2}%b%c%u%m%F{5})%f '
-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
+zstyle ':vcs_info:svn:*' branchformat '%b'
+zstyle ':vcs_info:svn:*' actionformats '%F{5}(%F{2}%b%F{1}:%{3}%i%F{3}|%F{1}%a%c%u%m%F{5})%f '
+zstyle ':vcs_info:svn:*' formats '%F{5}(%F{2}%b%F{1}:%F{3}%i%c%u%m%F{5})%f '
zstyle ':vcs_info:*' enable git cvs svn
zstyle ':vcs_info:git*+set-message:*' hooks untracked-git
diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme
index 9d8fb2488..5a5ab349f 100644
--- a/themes/jnrowe.zsh-theme
+++ b/themes/jnrowe.zsh-theme
@@ -4,7 +4,6 @@ autoload -Uz vcs_info
zstyle ':vcs_info:*' actionformats \
'%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:*' formats '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f '
-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
zstyle ':vcs_info:*' enable git
add-zsh-hook precmd prompt_vcs
diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme
index 51b0af724..e07be75c4 100644
--- a/themes/kolo.zsh-theme
+++ b/themes/kolo.zsh-theme
@@ -3,16 +3,18 @@ autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}●'
zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
zstyle ':vcs_info:*' check-for-changes true
-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
+zstyle ':vcs_info:svn:*' branchformat '%b'
+zstyle ':vcs_info:svn:*' formats ' [%b%F{1}:%F{11}%i%c%u%B%F{green}]'
zstyle ':vcs_info:*' enable git svn
+
theme_precmd () {
- if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
- zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
- } else {
- zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
- }
+ if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
+ zstyle ':vcs_info:git:*' formats ' [%b%c%u%B%F{green}]'
+ else
+ zstyle ':vcs_info:git:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
+ fi
- vcs_info
+ vcs_info
}
setopt prompt_subst
diff --git a/themes/linuxonly.zsh-theme b/themes/linuxonly.zsh-theme
index 2afae8fc3..98572b904 100644
--- a/themes/linuxonly.zsh-theme
+++ b/themes/linuxonly.zsh-theme
@@ -28,7 +28,6 @@ zstyle ':vcs_info:*' actionformats \
'%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:*' formats \
"%{$c8%}%s%{$c7%}:%{$c7%}(%{$c9%}%b%{$c7%})%f "
-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
zstyle ':vcs_info:*' enable git
add-zsh-hook precmd prompt_jnrowe_precmd
diff --git a/themes/michelebologna.zsh-theme b/themes/michelebologna.zsh-theme
index 7ff6a7ffe..bb86d68db 100644
--- a/themes/michelebologna.zsh-theme
+++ b/themes/michelebologna.zsh-theme
@@ -35,23 +35,17 @@ local reset="%{$reset_color%}"
local -a color_array
color_array=($green $red $cyan $yellow $blue $magenta $white)
-local username_normal_color=$white
-local username_root_color=$red
-local hostname_root_color=$red
-
-# calculating hostname color with hostname characters
-for i in `hostname`; local hostname_normal_color=$color_array[$[((#i))%7+1]]
-local -a hostname_color
-hostname_color=%(!.$hostname_root_color.$hostname_normal_color)
-
+local username_color=$white
+local hostname_color=$color_array[$[((#HOST))%7+1]] # choose hostname color based on first character
local current_dir_color=$blue
-local username_command="%n"
-local hostname_command="%m"
+
+local username="%n"
+local hostname="%m"
local current_dir="%~"
-local username_output="%(!..$username_normal_color$username_command$reset@)"
-local hostname_output="$hostname_color$hostname_command$reset"
-local current_dir_output="$current_dir_color$current_dir$reset"
+local username_output="%(!..${username_color}${username}${reset}@)"
+local hostname_output="${hostname_color}${hostname}${reset}"
+local current_dir_output="${current_dir_color}${current_dir}${reset}"
local jobs_bg="${red}fg: %j$reset"
local last_command_output="%(?.%(!.$red.$green).$yellow)"
@@ -68,8 +62,18 @@ ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=">"
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="<"
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="$red<>"
-PROMPT='$username_output$hostname_output:$current_dir_output%1(j. [$jobs_bg].)'
-GIT_PROMPT='$(out=$(git_prompt_info)$(git_prompt_status)$(git_remote_status);if [[ -n $out ]]; then printf %s " $white($green$out$white)$reset";fi)'
-PROMPT+="$GIT_PROMPT"
+function michelebologna_git_prompt {
+ local out=$(git_prompt_info)$(git_prompt_status)$(git_remote_status)
+ [[ -n $out ]] || return
+ printf " %s(%s%s%s)%s" \
+ "%{$fg_bold[white]%}" \
+ "%{$fg_bold[green]%}" \
+ "$out" \
+ "%{$fg_bold[white]%}" \
+ "%{$reset_color%}"
+}
+
+PROMPT="$username_output$hostname_output:$current_dir_output%1(j. [$jobs_bg].)"
+PROMPT+='$(michelebologna_git_prompt)'
PROMPT+=" $last_command_output%#$reset "
RPROMPT=''
diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme
index 849daf30b..260c9e701 100644
--- a/themes/trapd00r.zsh-theme
+++ b/themes/trapd00r.zsh-theme
@@ -102,7 +102,6 @@ zstyle ':vcs_info:*' actionformats \
zstyle ':vcs_info:*' formats \
"%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f "
-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
zstyle ':vcs_info:*' enable git
add-zsh-hook precmd prompt_jnrowe_precmd
diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme
index 27597ec6c..a00650ac8 100644
--- a/themes/zhann.zsh-theme
+++ b/themes/zhann.zsh-theme
@@ -3,16 +3,18 @@ autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}●'
zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
zstyle ':vcs_info:*' check-for-changes true
-zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
+zstyle ':vcs_info:svn:*' branchformat '%b'
+zstyle ':vcs_info:svn:*' formats ' [%b%F{1}:%F{11}%i%c%u%B%F{green}]'
zstyle ':vcs_info:*' enable git svn
+
theme_precmd () {
- if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
- zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
- } else {
- zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
- }
+ if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
+ zstyle ':vcs_info:git:*' formats ' [%b%c%u%B%F{green}]'
+ else
+ zstyle ':vcs_info:git:*' formats ' [%b%c%u%B%F{red}●%F{green}]'
+ fi
- vcs_info
+ vcs_info
}
setopt prompt_subst