diff options
Diffstat (limited to 'themes')
-rw-r--r-- | themes/agnoster.zsh-theme | 4 | ||||
-rw-r--r-- | themes/avit.zsh-theme | 4 | ||||
-rw-r--r-- | themes/fino.zsh-theme | 29 | ||||
-rw-r--r-- | themes/fishy.zsh-theme | 18 | ||||
-rw-r--r-- | themes/pygmalion-virtualenv.zsh-theme | 10 | ||||
-rw-r--r-- | themes/pygmalion.zsh-theme | 10 | ||||
-rw-r--r-- | themes/random.zsh-theme | 15 | ||||
-rw-r--r-- | themes/trapd00r.zsh-theme | 2 |
8 files changed, 62 insertions, 30 deletions
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index b0a3b7b3f..99707f684 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -131,7 +131,7 @@ prompt_git() { zstyle ':vcs_info:*' get-revision true zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' stagedstr '✚' - zstyle ':vcs_info:*' unstagedstr '●' + zstyle ':vcs_info:*' unstagedstr '±' zstyle ':vcs_info:*' formats ' %u%c' zstyle ':vcs_info:*' actionformats ' %u%c' vcs_info @@ -235,7 +235,7 @@ prompt_status() { # ends in '-prod' # - displays black on green otherwise prompt_aws() { - [[ -z "$AWS_PROFILE" ]] && return + [[ -z "$AWS_PROFILE" || "$SHOW_AWS_PROMPT" = false ]] && return case "$AWS_PROFILE" in *-prod|*production*) prompt_segment red yellow "AWS: $AWS_PROFILE" ;; *) prompt_segment green black "AWS: $AWS_PROFILE" ;; diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index 05b3fb212..921ed99d3 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -7,9 +7,9 @@ typeset +H _hist_no="%{$fg[grey]%}%h%{$reset_color%}" PROMPT=' $(_user_host)${_current_dir} $(git_prompt_info) $(ruby_prompt_info) -%{%(!.%F{red}.%F{white})%}▶%{$reset_color%} ' +%{%(!.${fg[red]}.${fg[white]})%}▶%{$reset_color%} ' -PROMPT2='%{%(!.%F{red}.%F{white})%}◀%{$reset_color%} ' +PROMPT2='%{%(!.${fg[red]}.${fg[white]})%}◀%{$reset_color%} ' RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}' diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme index 1d8bb30e1..2523c1776 100644 --- a/themes/fino.zsh-theme +++ b/themes/fino.zsh-theme @@ -11,26 +11,35 @@ # # Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ +function virtualenv_prompt_info { + [[ -n ${VIRTUAL_ENV} ]] || return + echo "${ZSH_THEME_VIRTUALENV_PREFIX:=[}${VIRTUAL_ENV:t}${ZSH_THEME_VIRTUALENV_SUFFIX:=]}" +} + function prompt_char { - git branch >/dev/null 2>/dev/null && echo "±" && return - echo '○' + command git branch &>/dev/null && echo "±" || echo '○' } function box_name { - [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST} + [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST} } -local ruby_env='using%{$FG[243]%} $(ruby_prompt_info)' +local ruby_env='$(ruby_prompt_info)' local git_info='$(git_prompt_info)' +local virtualenv_info='$(virtualenv_prompt_info)' local prompt_char='$(prompt_char)' - -PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}%~%{$reset_color%}${git_info} %{$FG[239]%}${ruby_env} +PROMPT="╭─${FG[040]}%n ${FG[239]}at ${FG[033]}$(box_name) ${FG[239]}in %B${FG[226]}%~%b${git_info}${ruby_env}${virtualenv_info} ╰─${prompt_char}%{$reset_color%} " -ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" +ZSH_THEME_GIT_PROMPT_PREFIX=" ${FG[239]}on%{$reset_color%} ${FG[255]}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘" -ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔" -ZSH_THEME_RUBY_PROMPT_PREFIX="‹" +ZSH_THEME_GIT_PROMPT_DIRTY="${FG[202]}✘✘✘" +ZSH_THEME_GIT_PROMPT_CLEAN="${FG[040]}✔" + +ZSH_THEME_RUBY_PROMPT_PREFIX=" ${FG[239]}using${FG[243]} ‹" ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}" + +export VIRTUAL_ENV_DISABLE_PROMPT=1 +ZSH_THEME_VIRTUALENV_PREFIX=" ${FG[239]}using${FG[243]} «" +ZSH_THEME_VIRTUALENV_SUFFIX="»%{$reset_color%}" diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme index 00a60f45b..2b8d559e5 100644 --- a/themes/fishy.zsh-theme +++ b/themes/fishy.zsh-theme @@ -1,12 +1,18 @@ # ZSH Theme emulating the Fish shell's default prompt. _fishy_collapsed_wd() { - echo $(pwd | perl -pe ' - BEGIN { - binmode STDIN, ":encoding(UTF-8)"; - binmode STDOUT, ":encoding(UTF-8)"; - }; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g -') + local i pwd + pwd=("${(s:/:)PWD/#$HOME/~}") + if (( $#pwd > 1 )); then + for i in {1..$(($#pwd-1))}; do + if [[ "$pwd[$i]" = .* ]]; then + pwd[$i]="${${pwd[$i]}[1,2]}" + else + pwd[$i]="${${pwd[$i]}[1]}" + fi + done + fi + echo "${(j:/:)pwd}" } local user_color='green'; [ $UID -eq 0 ] && user_color='red' diff --git a/themes/pygmalion-virtualenv.zsh-theme b/themes/pygmalion-virtualenv.zsh-theme index 605e3d10c..47b0b4fb1 100644 --- a/themes/pygmalion-virtualenv.zsh-theme +++ b/themes/pygmalion-virtualenv.zsh-theme @@ -17,6 +17,8 @@ function _virtualenv_prompt_info { } prompt_setup_pygmalion(){ + setopt localoptions extendedglob + ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" @@ -25,16 +27,18 @@ prompt_setup_pygmalion(){ base_prompt='$(_virtualenv_prompt_info)%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}' post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} ' - base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g") - post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g") + base_prompt_nocolor=${base_prompt//\%\{[^\}]##\}} + post_prompt_nocolor=${post_prompt//\%\{[^\}]##\}} autoload -U add-zsh-hook add-zsh-hook precmd prompt_pygmalion_precmd } prompt_pygmalion_precmd(){ + setopt localoptions extendedglob + local gitinfo=$(git_prompt_info) - local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g") + local gitinfo_nocolor=${gitinfo//\%\{[^\}]##\}} local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")" local prompt_length=${#exp_nocolor} diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme index bd58db5f6..b13adfd5f 100644 --- a/themes/pygmalion.zsh-theme +++ b/themes/pygmalion.zsh-theme @@ -1,6 +1,8 @@ # Yay! High voltage and arrows! prompt_setup_pygmalion(){ + setopt localoptions extendedglob + ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" @@ -9,16 +11,18 @@ prompt_setup_pygmalion(){ base_prompt='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}' post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} ' - base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g") - post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g") + base_prompt_nocolor=${base_prompt//\%\{[^\}]##\}} + post_prompt_nocolor=${post_prompt//\%\{[^\}]##\}} autoload -U add-zsh-hook add-zsh-hook precmd prompt_pygmalion_precmd } prompt_pygmalion_precmd(){ + setopt localoptions extendedglob + local gitinfo=$(git_prompt_info) - local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g") + local gitinfo_nocolor=${gitinfo//\%\{[^\}]##\}} local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")" local prompt_length=${#exp_nocolor} diff --git a/themes/random.zsh-theme b/themes/random.zsh-theme index 6cb7cc579..f0b8e5c18 100644 --- a/themes/random.zsh-theme +++ b/themes/random.zsh-theme @@ -1,3 +1,10 @@ +# Deprecate ZSH_THEME_RANDOM_BLACKLIST +if [[ -n "$ZSH_THEME_RANDOM_BLACKLIST" ]]; then + echo '[oh-my-zsh] ZSH_THEME_RANDOM_BLACKLIST is deprecated. Use `ZSH_THEME_RANDOM_IGNORED` instead.' + ZSH_THEME_RANDOM_IGNORED=($ZSH_THEME_RANDOM_BLACKLIST) + unset ZSH_THEME_RANDOM_BLACKLIST +fi + # Make themes a unique array typeset -Ua themes @@ -11,8 +18,8 @@ else "$ZSH_CUSTOM"/themes/*.zsh-theme(N:t:r) "$ZSH"/themes/*.zsh-theme(N:t:r) ) - # Remove blacklisted themes from the list - for theme in random ${ZSH_THEME_RANDOM_BLACKLIST[@]}; do + # Remove ignored themes from the list + for theme in random ${ZSH_THEME_RANDOM_IGNORED[@]}; do themes=("${(@)themes:#$theme}") done fi @@ -35,4 +42,6 @@ else return 1 fi -echo "[oh-my-zsh] Random theme '${RANDOM_THEME}' loaded" +if [[ -z "$ZSH_THEME_RANDOM_QUIET" ]]; then + echo "[oh-my-zsh] Random theme '${RANDOM_THEME}' loaded" +fi diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme index 7a589a699..4e3238393 100644 --- a/themes/trapd00r.zsh-theme +++ b/themes/trapd00r.zsh-theme @@ -2,7 +2,7 @@ # # This theme needs a terminal supporting 256 colors as well as unicode. # In order to avoid external dependencies, it also has a zsh version of -# the perl script at https://github.com/trapd00r/utils/blob/master/zsh_path, +# the previously used perl script https://github.com/trapd00r/utils/blob/master/zsh_path, # which splits up the current path and makes it fancy. # # By default it spans over two lines like so: |