4e42bdc306e5d8c1d0ff7c86be305e11b432c04f

Author
Claus Witt <claus@wittnezz.dk>
Committer
Claus Witt <claus@wittnezz.dk>
Date

Message

Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh

Diff

  1diff --git a/.gitignore b/.gitignore
  2index f84db6dc27af34f9f8e393f39a8aedf04ef86c0d..8d19d100c593afe9d4524f55b84c4b6c45eafbbd 100644
  3--- a/.gitignore
  4+++ b/.gitignore
  5@@ -1,5 +1,5 @@
  6 locals.zsh
  7 log/.zsh_history
  8 projects.zsh
  9-custom/*.zsh
 10+custom/*
 11 !custom/example.zsh
 12diff --git a/lib/directories.zsh b/lib/directories.zsh
 13index 56d7a2316db5cb56d6077e08f0b885f9b24b2c7a..bb114f61531a2086ebf16d9266d519dba592c0be 100644
 14--- a/lib/directories.zsh
 15+++ b/lib/directories.zsh
 16@@ -36,5 +36,9 @@ cd () {
 17 
 18 alias md='mkdir -p'
 19 alias rd=rmdir
 20+alias d='dirs -v'
 21 
 22-alias d='dirs -v'
 23+# mkdir & cd to it
 24+function mcd() { 
 25+  mkdir -p "$1" && cd "$1"; 
 26+}
 27diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh
 28index 65d3766f34f20c819e29ddba81a86d84f1c3675d..d4e5c6584a8289c6d4097cd2090fb71a48ef69c6 100644
 29--- a/plugins/gem/gem.plugin.zsh
 30+++ b/plugins/gem/gem.plugin.zsh
 31@@ -1,4 +1,4 @@
 32-# add brew completion function to path
 33+# add gem completion function to path
 34 fpath=($ZSH/plugins/gem $fpath)
 35 autoload -U compinit
 36 compinit -i
 37diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
 38index d317d179d8ec7bce0ecf600ec237d5c754f47215..71a62819bbd5decbd8de84a83f14ee98fbc56925 100644
 39--- a/plugins/git/git.plugin.zsh
 40+++ b/plugins/git/git.plugin.zsh
 41@@ -8,6 +8,7 @@ alias gd='git diff | mate'
 42 alias gdv='git diff -w "$@" | vim -R -'
 43 alias gc='git commit -v'
 44 alias gca='git commit -v -a'
 45+alias gco='git checkout'
 46 alias gb='git branch'
 47 alias gba='git branch -a'
 48 alias gcount='git shortlog -sn'
 49@@ -26,7 +27,7 @@ function current_branch() {
 50   echo ${ref#refs/heads/}
 51 }
 52 
 53-# these aliases take advangate of the previous function
 54+# these aliases take advantage of the previous function
 55 alias ggpull='git pull origin $(current_branch)'
 56 alias ggpush='git push origin $(current_branch)'
 57-alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
 58+alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
 59diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
 60new file mode 100644
 61index 0000000000000000000000000000000000000000..20ba0408ce8ccd1773282bfec3f87f6df97b418e
 62--- /dev/null
 63+++ b/plugins/rails3/rails3.plugin.zsh
 64@@ -0,0 +1,8 @@
 65+alias rs='ruby script/rails server'
 66+alias rg='ruby script/rails generate'
 67+alias rd='ruby script/rails destroy'
 68+alias rp='ruby script/rails plugin'
 69+alias rdbm='rake db:migrate db:test:clone'
 70+alias rc='ruby script/rails console'
 71+alias rd='ruby script/rais server --debugger'
 72+alias devlog='tail -f log/development.log'
 73diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
 74new file mode 100644
 75index 0000000000000000000000000000000000000000..45d4613069dafba044eece540faaf74266422b9e
 76--- /dev/null
 77+++ b/plugins/svn/svn.plugin.zsh
 78@@ -0,0 +1,42 @@
 79+function svn_prompt_info {
 80+    if [[ -d .svn ]]; then
 81+        echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
 82+$ZSH_THEME_REPO_NAME_COLOR$(svn_get_repo_name)$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR"
 83+    fi
 84+}
 85+
 86+
 87+function in_svn() {
 88+    if [[ -d .svn ]]; then
 89+        echo 1
 90+    fi
 91+}
 92+
 93+function svn_get_repo_name {
 94+    if [ is_svn ]; then
 95+        svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
 96+    
 97+        svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//"
 98+    fi
 99+}
100+
101+function svn_get_rev_nr {
102+    if [ is_svn ]; then
103+        svn info 2> /dev/null | sed -n s/Revision:\ //p
104+    fi
105+}
106+
107+function svn_dirty_choose {
108+    if [ is_svn ]; then
109+        s=$(svn status 2>/dev/null)
110+        if [ $s ]; then 
111+            echo $1
112+        else 
113+            echo $2
114+        fi
115+    fi
116+}
117+
118+function svn_dirty {
119+    svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN
120+}
121diff --git a/themes/afowler.zsh-theme b/themes/afowler.zsh-theme
122index b5a9bb1730da771dd6cc253e1676e3382285b808..3a4753fc105f01c21e30d7886f887360cec74da7 100644
123--- a/themes/afowler.zsh-theme
124+++ b/themes/afowler.zsh-theme
125@@ -1,4 +1,4 @@
126-if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
127+if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
128 
129 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
130 
131diff --git a/themes/arrow.zsh-theme b/themes/arrow.zsh-theme
132index a23efd1d763e3f4fca4f488f7286958c76d0fe07..d62dcdcb9d7fc8cdb47206675dc9250d8efe6c96 100644
133--- a/themes/arrow.zsh-theme
134+++ b/themes/arrow.zsh-theme
135@@ -1,4 +1,4 @@
136-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
137+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
138 
139 PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}'
140 RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}'
141diff --git a/themes/awesomepanda.zsh-theme b/themes/awesomepanda.zsh-theme
142new file mode 100644
143index 0000000000000000000000000000000000000000..411b898371ade495a7924e6cd871d8f442d13b82
144--- /dev/null
145+++ b/themes/awesomepanda.zsh-theme
146@@ -0,0 +1,18 @@
147+# the svn plugin has to be activated for this to work.
148+
149+PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}'
150+
151+ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
152+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
153+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%} ✗ %{$reset_color%}"
154+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) "
155+
156+
157+
158+ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}"
159+ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}"
160+
161+ZSH_THEME_SVN_PROMPT_PREFIX="svn:("
162+ZSH_THEME_SVN_PROMPT_SUFFIX=")"
163+ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}"
164+ZSH_THEME_SVN_PROMPT_CLEAN=" "
165diff --git a/themes/clean.zsh-theme b/themes/clean.zsh-theme
166index 95f532a823f589722c35fe95e6ae282126b69d16..7ee29cb8ccea928eb93da029ba95b14fc18c4ffc 100644
167--- a/themes/clean.zsh-theme
168+++ b/themes/clean.zsh-theme
169@@ -1,4 +1,4 @@
170-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="white"; fi
171+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi
172 
173 PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
174 RPROMPT='[%*]'
175diff --git a/themes/dieter.zsh-theme b/themes/dieter.zsh-theme
176new file mode 100644
177index 0000000000000000000000000000000000000000..0a5e9265bd680e628c2da9ae61b5ae37159d1214
178--- /dev/null
179+++ b/themes/dieter.zsh-theme
180@@ -0,0 +1,56 @@
181+# the idea of this theme is to contain a lot of info in a small string, by
182+# compressing some parts and colorcoding, which bring useful visual cues,
183+# while limiting the amount of colors and such to keep it easy on the eyes.
184+# When a command exited >0, the timestamp will be in red and the exit code
185+# will be on the right edge.
186+# The exit code visual cues will only display once.
187+# (i.e. they will be reset, even if you hit enter a few times on empty command prompts)
188+
189+typeset -A host_repr
190+
191+# translate hostnames into shortened, colorcoded strings
192+host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4")
193+
194+# local time, color coded by last return code
195+time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
196+time_disabled="%{$fg[green]%}%*%{$reset_color%}"
197+time=$time_enabled
198+
199+# user part, color coded by privileges
200+local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
201+
202+# Hostname part.  compressed and colorcoded per host_repr array
203+# if not found, regular hostname in default color
204+local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}"
205+
206+# Compacted $PWD
207+local pwd="%{$fg[blue]%}%c%{$reset_color%}"
208+
209+PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)'
210+
211+# i would prefer 1 icon that shows the "most drastic" deviation from HEAD,
212+# but lets see how this works out
213+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}"
214+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
215+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}"
216+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
217+
218+# elaborate exitcode on the right when >0
219+return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
220+return_code_disabled=
221+return_code=$return_code_enabled
222+
223+RPS1='${return_code}'
224+
225+function accept-line-or-clear-warning () {
226+	if [[ -z $BUFFER ]]; then
227+		time=$time_disabled
228+		return_code=$return_code_disabled
229+	else
230+		time=$time_enabled
231+		return_code=$return_code_enabled
232+	fi
233+	zle accept-line
234+}
235+zle -N accept-line-or-clear-warning
236+bindkey '^M' accept-line-or-clear-warning
237diff --git a/themes/dst.zsh-theme b/themes/dst.zsh-theme
238index fa0d9cb06bf605df6a54f3db163e52e9c6e31176..3e2539d57592937a074e0c01e68bd76cf0d539d2 100644
239--- a/themes/dst.zsh-theme
240+++ b/themes/dst.zsh-theme
241@@ -5,7 +5,7 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
242 ZSH_THEME_GIT_PROMPT_CLEAN=""
243 
244 function prompt_char {
245-	if [ "$(whoami)" = "root" ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
246+	if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
247 }
248 
249 PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%}
250diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme
251new file mode 100644
252index 0000000000000000000000000000000000000000..f22eda868501accc1aed45380a70d634eb8d0435
253--- /dev/null
254+++ b/themes/fishy.zsh-theme
255@@ -0,0 +1,9 @@
256+# ZSH Theme emulating the Fish shell's default prompt.
257+
258+local user_color='green'; [ $UID -eq 0 ] && user_color='red'
259+PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) '
260+PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
261+RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%})$(git_prompt_info)'
262+
263+ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}"
264+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
265diff --git a/themes/flazz.zsh-theme b/themes/flazz.zsh-theme
266new file mode 100644
267index 0000000000000000000000000000000000000000..280794f2b83c33bf3c039e2fdb3a868b92d55ca2
268--- /dev/null
269+++ b/themes/flazz.zsh-theme
270@@ -0,0 +1,19 @@
271+if [ "$(whoami)" = "root" ]
272+then CARETCOLOR="red"
273+else CARETCOLOR="blue"
274+fi
275+
276+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
277+
278+PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} '
279+
280+RPS1='$(vi_mode_prompt_info) ${return_code}'
281+
282+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}‹"
283+ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
284+
285+MODE_INDICATOR="%{$fg_bold[magenta]%}<%{$reset_color%}%{$fg[magenta]%}<<%{$reset_color%}"
286+
287+# TODO use 265 colors
288+#MODE_INDICATOR="$FX[bold]$FG[020]<$FX[no_bold]%{$fg[blue]%}<<%{$reset_color%}"
289+# TODO use two lines if git
290diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme
291new file mode 100644
292index 0000000000000000000000000000000000000000..cba143d426d0dadd49d1d8a9be2e966501f5c580
293--- /dev/null
294+++ b/themes/gentoo.zsh-theme
295@@ -0,0 +1,4 @@
296+PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%#%{$reset_color%} '
297+
298+ZSH_THEME_GIT_PROMPT_PREFIX="("
299+ZSH_THEME_GIT_PROMPT_SUFFIX=") "
300diff --git a/themes/jreese.zsh-theme b/themes/jreese.zsh-theme
301index 534664f115e4c8b5bcd3af8eb360362ea6de6b6b..0fa6b4ecd5e85596e80e7cc1dd1894878aa0f7ac 100644
302--- a/themes/jreese.zsh-theme
303+++ b/themes/jreese.zsh-theme
304@@ -1,6 +1,6 @@
305 # ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png
306 
307-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
308+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
309 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
310 
311 PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \
312diff --git a/themes/kardan.zsh-theme b/themes/kardan.zsh-theme
313new file mode 100644
314index 0000000000000000000000000000000000000000..fd6586a9d70ce03e7fe20bdc7921d66b94e3576e
315--- /dev/null
316+++ b/themes/kardan.zsh-theme
317@@ -0,0 +1,12 @@
318+# Simple theme based on my old zsh settings.
319+
320+function get_host {
321+	echo '@'`hostname`''
322+}
323+
324+PROMPT='> '
325+RPROMPT='%~$(git_prompt_info)$(get_host)'
326+
327+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}✗%{$reset_color%}"
328+ZSH_THEME_GIT_PROMPT_PREFIX="("
329+ZSH_THEME_GIT_PROMPT_SUFFIX=")"
330diff --git a/themes/lambda.zsh-theme b/themes/lambda.zsh-theme
331new file mode 100644
332index 0000000000000000000000000000000000000000..63292d3314607a0abbabcc2ce0002d39b975f218
333--- /dev/null
334+++ b/themes/lambda.zsh-theme
335@@ -0,0 +1,6 @@
336+# ZSH Theme - Preview: http://cl.ly/350F0F0k1M2y3A2i3p1S
337+
338+PROMPT='λ %~/ $(git_prompt_info)%{$reset_color%}'
339+
340+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}"
341+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
342diff --git a/themes/philips.zsh-theme b/themes/philips.zsh-theme
343index fa7c590355a2a1fcd8b7c4d87ad19e9f234be2eb..e7ea51a2ff8202536a24790780064ecf0d6ade7f 100644
344--- a/themes/philips.zsh-theme
345+++ b/themes/philips.zsh-theme
346@@ -1,4 +1,4 @@
347-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
348+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
349 
350 PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
351 RPROMPT='[%*]'
352diff --git a/themes/pmcgee.zsh-theme b/themes/pmcgee.zsh-theme
353index 4eb54df5baaf5922c19a801882359de3f737ef27..e4e45c71adfa23054eca9eb3daadda8856b6874c 100644
354--- a/themes/pmcgee.zsh-theme
355+++ b/themes/pmcgee.zsh-theme
356@@ -1,4 +1,4 @@
357-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
358+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
359 
360 PROMPT='
361 %{$fg[$NCOLOR]%}%B%n@%m%b%{$reset_color%} %{$fg[white]%}%B${PWD/#$HOME/~}%b%{$reset_color%}
362diff --git a/themes/rixius.zsh-theme b/themes/rixius.zsh-theme
363new file mode 100644
364index 0000000000000000000000000000000000000000..c0c5c9c718ad77d52876c8438903ad40069f24a9
365--- /dev/null
366+++ b/themes/rixius.zsh-theme
367@@ -0,0 +1,24 @@
368+# /|/ Code by Stephen
369+# /|/ "Rixius" Middleton
370+# 
371+# name in folder (github)
372+# ± if in github repo, or ≥ if otherwise Time in 24-hour format is on right.
373+function collapse_pwd {
374+    echo $(pwd | sed -e "s,^$HOME,~,")
375+}
376+function prompt_char {
377+    echo -n "%{$bg[white]%}%{$fg[red]%}"
378+    git branch >/dev/null 2>/dev/null && echo "±%{$reset_color%}" && return
379+    echo "≥%{$reset_color%}"
380+}
381+RIXIUS_PRE="%{$bg[white]%}%{$fg[red]%}"
382+
383+PROMPT='
384+%{$RIXIUS_PRE%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)
385+$(prompt_char) '
386+RPROMPT='%{$RIXIUS_PRE%}%T%{$reset_color%}'
387+
388+ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
389+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
390+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RIXIUS_PRE%}!%{$reset_color%}"
391+ZSH_THEME_GIT_PROMPT_CLEAN=" %{$RIXIUS_PRE%}√%{$reset_color%}"