2193135ebc4ce0778ff6949b448e4526dbd34284

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Clean up appearance lib file and redundant `colors` calls in other files

Diff

  1diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
  2index 0353f9db4d1c5ac973264132c316fde2dc084cf7..926303ca4509cd89bbc30187fd99879c1fbeb771 100644
  3--- a/lib/theme-and-appearance.zsh
  4+++ b/lib/theme-and-appearance.zsh
  5@@ -1,14 +1,13 @@
  6 # ls colors
  7-autoload colors; colors;
  8+autoload -U colors && colors
  9 export LSCOLORS="Gxfxcxdxbxegedabagacad"
 10-#export LS_COLORS
 11 
 12 # Enable ls colors
 13 if [ "$DISABLE_LS_COLORS" != "true" ]
 14 then
 15   # Find the option for using colors in ls, depending on the version: Linux or BSD
 16   if [[ "$(uname -s)" == "NetBSD" ]]; then
 17-    # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors); 
 18+    # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
 19     # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
 20     gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
 21   elif [[ "$(uname -s)" == "OpenBSD" ]]; then
 22@@ -23,7 +22,7 @@ fi
 23 #setopt no_beep
 24 setopt auto_cd
 25 setopt multios
 26-setopt cdablevarS
 27+setopt cdablevars
 28 
 29 if [[ x$WINDOW != x ]]
 30 then
 31@@ -43,4 +42,3 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""               # Text to display if the branch is c
 32 
 33 # Setup the prompt with pretty colors
 34 setopt prompt_subst
 35-
 36diff --git a/plugins/git-prompt/git-prompt.plugin.zsh b/plugins/git-prompt/git-prompt.plugin.zsh
 37index 01b8a88d921247bc43d5e003956ffb4fefa2dd53..d868a5fe1d1bf6b6117db674b093d1a632f5d0d7 100644
 38--- a/plugins/git-prompt/git-prompt.plugin.zsh
 39+++ b/plugins/git-prompt/git-prompt.plugin.zsh
 40@@ -2,9 +2,6 @@
 41 # http://github.com/olivierverdier/zsh-git-prompt
 42 #
 43 export __GIT_PROMPT_DIR=$ZSH/plugins/git-prompt
 44-# Initialize colors.
 45-autoload -U colors
 46-colors
 47 
 48 # Allow for functions in the prompt.
 49 setopt PROMPT_SUBST
 50diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
 51index b16814fe4d12b9935a046e745ab46169090c3446..d082c11e54280c392846ef8800545ef9d01a0644 100644
 52--- a/plugins/jump/jump.plugin.zsh
 53+++ b/plugins/jump/jump.plugin.zsh
 54@@ -27,7 +27,6 @@ unmark() {
 55 	rm -i "$MARKPATH/$1"
 56 }
 57 
 58-autoload colors
 59 marks() {
 60 	for link in $MARKPATH/*(@); do
 61 		local markname="$fg[cyan]${link:t}$reset_color"
 62diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme
 63index 6869c8a20ae20203ded67bd33f1ee987af09bd19..212b823a5c95c3a8bd64f39480fb7b9ab6d2be25 100644
 64--- a/themes/adben.zsh-theme
 65+++ b/themes/adben.zsh-theme
 66@@ -69,17 +69,17 @@ function precmd {
 67         #Choose from all databases, regardless of whether they are considered "offensive"
 68         fortune -a
 69     }
 70-    #obtains the tip 
 71+    #obtains the tip
 72     ps1_command_tip () {
 73         wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d'
 74-    }  
 75+    }
 76     prompt_header () {
 77         if [[ "true" == "$ENABLE_COMMAND_TIP" ]]; then
 78             ps1_command_tip
 79         else
 80             ps1_fortune
 81-        fi 
 82-    }   
 83+        fi
 84+    }
 85     PROMPT_HEAD="${RED_START}${PR_YELLOW}$(prompt_header)${PR_RESET}"
 86     # set a simple variable to show when in screen
 87     if [[ -n "${WINDOW}" ]]; then
 88@@ -99,11 +99,8 @@ prompt_context () {
 89 set_prompt () {
 90     # required for the prompt
 91     setopt prompt_subst
 92-    autoload colors zsh/terminfo
 93-    if [[ "$terminfo[colors]" -gt 8 ]]; then
 94-        colors
 95-    fi 
 96-    
 97+    autoload zsh/terminfo
 98+
 99     # ######### PROMPT #########
100     PROMPT='${PROMPT_HEAD}
101 ${RED_START}$(prompt_context)
102diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme
103index 275341dc67a8d85caafe92d78ab414787f104cdc..95e6249fa897a46ab12c80b9b3f18b99dc1f0ba7 100644
104--- a/themes/apple.zsh-theme
105+++ b/themes/apple.zsh-theme
106@@ -7,7 +7,6 @@ get_git_dirty() {
107 }
108 
109 autoload -Uz vcs_info
110-autoload -U colors && colors
111 zstyle ':vcs_info:*' check-for-changes true
112 zstyle ':vcs_info:*' unstagedstr '%F{red}*'   # display this when there are unstaged changes
113 zstyle ':vcs_info:*' stagedstr '%F{yellow}+'  # display this when there are staged changes
114diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme
115index 0519fbefb4150397be44d164cb6c93edcc8d9470..ab154c1e5cbc8a5cdbd014a11c2967449d591530 100644
116--- a/themes/gnzh.zsh-theme
117+++ b/themes/gnzh.zsh-theme
118@@ -2,8 +2,7 @@
119 # Based on bira theme
120 
121 # load some modules
122-autoload -U colors zsh/terminfo # Used in the colour alias below
123-colors
124+autoload -U zsh/terminfo # Used in the colour alias below
125 setopt prompt_subst
126 
127 # make some aliases for the colours: (could use normal escape sequences too)
128diff --git a/themes/half-life.zsh-theme b/themes/half-life.zsh-theme
129index 942affa94dc3a746ff8895048cb151abd303af64..a3c50570626f8011d4677925ace04929788d4041 100644
130--- a/themes/half-life.zsh-theme
131+++ b/themes/half-life.zsh-theme
132@@ -13,8 +13,6 @@ function virtualenv_info {
133 PR_GIT_UPDATE=1
134 
135 setopt prompt_subst
136-autoload colors
137-colors
138 
139 autoload -U add-zsh-hook
140 autoload -Uz vcs_info
141diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
142index bca92970c48f63748e4df10b92d1c43fe6386d18..2f0e774315dbb31564ae8d43c5466d1f361c4ec4 100644
143--- a/themes/jonathan.zsh-theme
144+++ b/themes/jonathan.zsh-theme
145@@ -44,10 +44,7 @@ setprompt () {
146     ###
147     # See if we can use colors.
148 
149-    autoload colors zsh/terminfo
150-    if [[ "$terminfo[colors]" -ge 8 ]]; then
151-	colors
152-    fi
153+    autoload zsh/terminfo
154     for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do
155 	eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
156 	eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
157diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme
158index e743289c35aff6561f519b4702c5b070df08320a..51b0af724aff06735f0aef28381d9787e03f6e94 100644
159--- a/themes/kolo.zsh-theme
160+++ b/themes/kolo.zsh-theme
161@@ -1,5 +1,3 @@
162-autoload -U colors && colors
163-
164 autoload -Uz vcs_info
165 
166 zstyle ':vcs_info:*' stagedstr '%F{green}●'
167diff --git a/themes/mikeh.zsh-theme b/themes/mikeh.zsh-theme
168index 943f04d389ccee2883584b8c55b9518126d3b4a4..a95383ba56d356b0fed972229468ca1673adaea4 100644
169--- a/themes/mikeh.zsh-theme
170+++ b/themes/mikeh.zsh-theme
171@@ -1,6 +1,4 @@
172 setopt prompt_subst
173-autoload colors
174-colors
175 
176 autoload -U add-zsh-hook
177 autoload -Uz vcs_info
178diff --git a/themes/simonoff.zsh-theme b/themes/simonoff.zsh-theme
179index fb4d32e2419a42d759af0bc224912c68c7b9117b..63ce4261bf61348a01c3cdb2526b638c563f3602 100644
180--- a/themes/simonoff.zsh-theme
181+++ b/themes/simonoff.zsh-theme
182@@ -63,10 +63,7 @@ setprompt () {
183 ###
184 # See if we can use colors.
185 
186-    autoload colors zsh/terminfo
187-    if [[ "$terminfo[colors]" -ge 8 ]]; then
188-    colors
189-    fi
190+    autoload zsh/terminfo
191     for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
192     eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
193     eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
194diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme
195index e38188d353daafe1d7673719b9a99c9fe78aa87c..13728ca9a9b95fe7bcef160ef5e01f1d2ec3a3b0 100644
196--- a/themes/steeef.zsh-theme
197+++ b/themes/steeef.zsh-theme
198@@ -15,8 +15,6 @@ function virtualenv_info {
199 PR_GIT_UPDATE=1
200 
201 setopt prompt_subst
202-autoload colors
203-colors
204 
205 autoload -U add-zsh-hook
206 autoload -Uz vcs_info
207diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme
208index 5c085473002a5decae40d9cc7dec78beb5cdf586..27597ec6ce6de3720b58e722c6d3a1f108867285 100644
209--- a/themes/zhann.zsh-theme
210+++ b/themes/zhann.zsh-theme
211@@ -1,5 +1,3 @@
212-autoload -U colors && colors
213-
214 autoload -Uz vcs_info
215 
216 zstyle ':vcs_info:*' stagedstr '%F{green}●'