143dd165e973a3559fbc1b085f1ff05e263f85b0
- Author
- NanoTech <nanotech008@gmail.com>
- Committer
- NanoTech <nanotech008@gmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
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/aliases.zsh b/lib/aliases.zsh
13index d2d3aed811f08191cab9c012de2284e4f32b8354..b47de5bde5a573e4c9465048111c133b3213edc3 100644
14--- a/lib/aliases.zsh
15+++ b/lib/aliases.zsh
16@@ -21,3 +21,5 @@ alias ll='ls -l'
17 alias sl=ls # often screw this up
18
19 alias afind='ack-grep -il'
20+
21+alias x=extract
22diff --git a/lib/appearance.zsh b/lib/appearance.zsh
23index ffee52b5e50a6e354d1adb5d94d877fe7ea3cb57..aec67721a8414ba3386b4d2a9f87306235e3eb16 100644
24--- a/lib/appearance.zsh
25+++ b/lib/appearance.zsh
26@@ -34,5 +34,3 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is c
27 # Setup the prompt with pretty colors
28 setopt prompt_subst
29
30-# Load the theme
31-source "$ZSH/themes/$ZSH_THEME.zsh-theme"
32diff --git a/lib/completion.zsh b/lib/completion.zsh
33index 52cc5b53c0fe14d4b65953d04cee4342122794de..9c2dfecca3cc82ee5f3b1231f11b7a9f75e2e3a4 100644
34--- a/lib/completion.zsh
35+++ b/lib/completion.zsh
36@@ -34,9 +34,31 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm
37 zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
38 cdpath=(.)
39
40+# use /etc/hosts and known_hosts for hostname completion
41+[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
42+[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
43+hosts=(
44+ "$_ssh_hosts[@]"
45+ "$_etc_hosts[@]"
46+ `hostname`
47+ localhost
48+)
49+zstyle ':completion:*:hosts' hosts $hosts
50+
51+# Use caching so that commands like apt and dpkg complete are useable
52+zstyle ':completion::complete:*' use-cache 1
53+zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/
54+
55+# Don't complete uninteresting users
56+zstyle ':completion:*:*:*:users' ignored-patterns \
57+ adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
58+ dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
59+ hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
60+ mailman mailnull mldonkey mysql nagios \
61+ named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
62+ operator pcap postfix postgres privoxy pulse pvm quagga radvd \
63+ rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs
64+
65+# ... unless we really want to.
66+zstyle '*' single-ignored show
67
68-# Load known hosts file for auto-completion with ssh and scp commands
69-if [ -f ~/.ssh/known_hosts ]; then
70- zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
71- zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`
72-fi
73diff --git a/lib/directories.zsh b/lib/directories.zsh
74index 56d7a2316db5cb56d6077e08f0b885f9b24b2c7a..bb114f61531a2086ebf16d9266d519dba592c0be 100644
75--- a/lib/directories.zsh
76+++ b/lib/directories.zsh
77@@ -36,5 +36,9 @@ cd () {
78
79 alias md='mkdir -p'
80 alias rd=rmdir
81+alias d='dirs -v'
82
83-alias d='dirs -v'
84+# mkdir & cd to it
85+function mcd() {
86+ mkdir -p "$1" && cd "$1";
87+}
88diff --git a/lib/functions.zsh b/lib/functions.zsh
89index e3c0de43ed8852c672b877177898f27f52af2a02..914f2ef25a22d141cfd2e8c9c6255e535641274b 100644
90--- a/lib/functions.zsh
91+++ b/lib/functions.zsh
92@@ -37,3 +37,39 @@ function take() {
93 mkdir -p $1
94 cd $1
95 }
96+
97+function extract() {
98+ unset REMOVE_ARCHIVE
99+
100+ if test "$1" = "-r"; then
101+ REMOVE=1
102+ shift
103+ fi
104+ if [[ -f $1 ]]; then
105+ case $1 in
106+ *.tar.bz2) tar xvjf $1;;
107+ *.tar.gz) tar xvzf $1;;
108+ *.tar.xz) tar xvJf $1;;
109+ *.tar.lzma) tar --lzma -xvf $1;;
110+ *.bz2) bunzip $1;;
111+ *.rar) unrar $1;;
112+ *.gz) gunzip $1;;
113+ *.tar) tar xvf $1;;
114+ *.tbz2) tar xvjf $1;;
115+ *.tgz) tar xvzf $1;;
116+ *.zip) unzip $1;;
117+ *.Z) uncompress $1;;
118+ *.7z) 7z x $1;;
119+ *) echo "'$1' cannot be extracted via >extract<";;
120+ esac
121+
122+ if [[ $REMOVE_ARCHIVE -eq 1 ]]; then
123+ echo removing "$1";
124+ /bin/rm "$1";
125+ fi
126+
127+ else
128+ echo "'$1' is not a valid file"
129+ fi
130+}
131+
132diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
133index 848e48eb5e7002391a4a352c8bd7828a09023998..291772dfe0b8bc5345717ef2b185eb7b52fa3194 100644
134--- a/oh-my-zsh.sh
135+++ b/oh-my-zsh.sh
136@@ -14,6 +14,9 @@ for config_file ($ZSH/custom/*.zsh) source $config_file
137 plugin=${plugin:=()}
138 for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
139
140+# Load the theme
141+source "$ZSH/themes/$ZSH_THEME.zsh-theme"
142+
143 # Check for updates on initial load...
144 if [ "$DISABLE_AUTO_UPDATE" = "true" ]
145 then
146diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh
147new file mode 100644
148index 0000000000000000000000000000000000000000..5ab03d5a9a57c3ff3f46a9ae881e6bb1643becbd
149--- /dev/null
150+++ b/plugins/command-not-found/command-not-found.plugin.zsh
151@@ -0,0 +1,5 @@
152+# Uses the command-not-found package zsh support
153+# as seen in http://www.porcheron.info/command-not-found-for-zsh/
154+# this is installed in Ubuntu
155+
156+source /etc/zsh_command_not_found
157diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh
158index 65d3766f34f20c819e29ddba81a86d84f1c3675d..d4e5c6584a8289c6d4097cd2090fb71a48ef69c6 100644
159--- a/plugins/gem/gem.plugin.zsh
160+++ b/plugins/gem/gem.plugin.zsh
161@@ -1,4 +1,4 @@
162-# add brew completion function to path
163+# add gem completion function to path
164 fpath=($ZSH/plugins/gem $fpath)
165 autoload -U compinit
166 compinit -i
167diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
168index d317d179d8ec7bce0ecf600ec237d5c754f47215..71a62819bbd5decbd8de84a83f14ee98fbc56925 100644
169--- a/plugins/git/git.plugin.zsh
170+++ b/plugins/git/git.plugin.zsh
171@@ -8,6 +8,7 @@ alias gd='git diff | mate'
172 alias gdv='git diff -w "$@" | vim -R -'
173 alias gc='git commit -v'
174 alias gca='git commit -v -a'
175+alias gco='git checkout'
176 alias gb='git branch'
177 alias gba='git branch -a'
178 alias gcount='git shortlog -sn'
179@@ -26,7 +27,7 @@ function current_branch() {
180 echo ${ref#refs/heads/}
181 }
182
183-# these aliases take advangate of the previous function
184+# these aliases take advantage of the previous function
185 alias ggpull='git pull origin $(current_branch)'
186 alias ggpush='git push origin $(current_branch)'
187-alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
188+alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
189diff --git a/plugins/lighthouse/lighthouse.plugin.zsh b/plugins/lighthouse/lighthouse.plugin.zsh
190index 4eb06a997100bf1f08394626c129f571030a7517..7661c6add6124a30a9544c47fdd4521657e3d69f 100644
191--- a/plugins/lighthouse/lighthouse.plugin.zsh
192+++ b/plugins/lighthouse/lighthouse.plugin.zsh
193@@ -4,7 +4,7 @@
194 # Example usage: http://screencast.com/t/ZDgwNDUwNT
195 open_lighthouse_ticket () {
196 if [ ! -f .lighthouse-url ]; then
197- echo "There is no .lighthouse file in the current directory..."
198+ echo "There is no .lighthouse-url file in the current directory..."
199 return 0;
200 else
201 lighthouse_url=$(cat .lighthouse-url);
202@@ -13,4 +13,4 @@ open_lighthouse_ticket () {
203 fi
204 }
205
206-alias lho='open_lighthouse_ticket'
207+alias lho='open_lighthouse_ticket'
208diff --git a/plugins/phing/phing.plugin.zsh b/plugins/phing/phing.plugin.zsh
209new file mode 100644
210index 0000000000000000000000000000000000000000..80e33462952f42d6533b09583b5dfb00fefda1c0
211--- /dev/null
212+++ b/plugins/phing/phing.plugin.zsh
213@@ -0,0 +1,20 @@
214+_phing_does_target_list_need_generating () {
215+ if [ ! -f .phing_targets ]; then return 0;
216+ else
217+ accurate=$(stat -f%m .phing_targets)
218+ changed=$(stat -f%m build.xml)
219+ return $(expr $accurate '>=' $changed)
220+ fi
221+}
222+
223+_phing () {
224+ if [ -f build.xml ]; then
225+ if _phing_does_target_list_need_generating; then
226+ echo "\nGenerating .phing_targets..." > /dev/stderr
227+ phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
228+ fi
229+ compadd `cat .phing_targets`
230+ fi
231+}
232+
233+compdef _phing phing
234diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
235new file mode 100644
236index 0000000000000000000000000000000000000000..20ba0408ce8ccd1773282bfec3f87f6df97b418e
237--- /dev/null
238+++ b/plugins/rails3/rails3.plugin.zsh
239@@ -0,0 +1,8 @@
240+alias rs='ruby script/rails server'
241+alias rg='ruby script/rails generate'
242+alias rd='ruby script/rails destroy'
243+alias rp='ruby script/rails plugin'
244+alias rdbm='rake db:migrate db:test:clone'
245+alias rc='ruby script/rails console'
246+alias rd='ruby script/rais server --debugger'
247+alias devlog='tail -f log/development.log'
248diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
249new file mode 100644
250index 0000000000000000000000000000000000000000..45d4613069dafba044eece540faaf74266422b9e
251--- /dev/null
252+++ b/plugins/svn/svn.plugin.zsh
253@@ -0,0 +1,42 @@
254+function svn_prompt_info {
255+ if [[ -d .svn ]]; then
256+ echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
257+$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"
258+ fi
259+}
260+
261+
262+function in_svn() {
263+ if [[ -d .svn ]]; then
264+ echo 1
265+ fi
266+}
267+
268+function svn_get_repo_name {
269+ if [ is_svn ]; then
270+ svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
271+
272+ svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p" | sed "s/\/.*$//"
273+ fi
274+}
275+
276+function svn_get_rev_nr {
277+ if [ is_svn ]; then
278+ svn info 2> /dev/null | sed -n s/Revision:\ //p
279+ fi
280+}
281+
282+function svn_dirty_choose {
283+ if [ is_svn ]; then
284+ s=$(svn status 2>/dev/null)
285+ if [ $s ]; then
286+ echo $1
287+ else
288+ echo $2
289+ fi
290+ fi
291+}
292+
293+function svn_dirty {
294+ svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN
295+}
296diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant
297new file mode 100644
298index 0000000000000000000000000000000000000000..483b29c53d57186b01ec55d780f8debce0cb5995
299--- /dev/null
300+++ b/plugins/vagrant/_vagrant
301@@ -0,0 +1,104 @@
302+#compdef vagrant
303+#autoload
304+
305+# vagrant zsh completion
306+
307+local -a _1st_arguments
308+_1st_arguments=(
309+ 'box:Box commands'
310+ 'destroy:Destroys the vagrant environment'
311+ 'halt:Halts the currently running vagrant environment'
312+ 'help:[TASK] Describe available tasks or one specific task'
313+ 'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
314+ 'package:Packages a vagrant environment for distribution'
315+ 'provision:Run the provisioner'
316+ 'reload:Reload the vagrant environment'
317+ 'resume:Resumes a suspend vagrant environment'
318+ 'ssh:SSH into the currently running environment'
319+ 'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.'
320+ 'status:Shows the status of the current Vagrant environment.'
321+ 'suspend:Suspends the currently running vagrant environment'
322+ 'up:Creates the vagrant environment'
323+ 'version:Prints the Vagrant version information'
324+)
325+
326+local -a _box_arguments
327+_box_arguments=(
328+ 'add:NAME URI Add a box to the system'
329+ 'help:COMMAND Describe subcommands or one specific subcommand'
330+ 'list:Lists all installed boxes'
331+ 'remove:NAME Remove a box from the system'
332+ 'repackage:NAME Repackage an installed box into a `.box` file.'
333+)
334+
335+__task_list ()
336+{
337+ local expl
338+ declare -a tasks
339+
340+ tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
341+
342+ _wanted tasks expl 'help' compadd $tasks
343+}
344+
345+__box_list ()
346+{
347+ _wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
348+}
349+
350+__vagrant-box ()
351+{
352+ local curcontext="$curcontext" state line
353+ typeset -A opt_args
354+
355+ _arguments -C \
356+ ':command:->command' \
357+ '*::options:->options'
358+
359+ case $state in
360+ (command)
361+ _describe -t commands "gem subcommand" _box_arguments
362+ return
363+ ;;
364+
365+ (options)
366+ case $line[1] in
367+ (repackage|remove)
368+ _arguments ':feature:__box_list'
369+ ;;
370+ esac
371+ ;;
372+ esac
373+}
374+
375+
376+
377+
378+local expl
379+local -a boxes installed_boxes
380+
381+local curcontext="$curcontext" state line
382+typeset -A opt_args
383+
384+_arguments -C \
385+ ':command:->command' \
386+ '*::options:->options'
387+
388+case $state in
389+ (command)
390+ _describe -t commands "gem subcommand" _1st_arguments
391+ return
392+ ;;
393+
394+ (options)
395+ case $line[1] in
396+ (help)
397+ _arguments ':feature:__task_list'
398+ ;;
399+
400+ (box)
401diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh
402new file mode 100644
403index 0000000000000000000000000000000000000000..5e9bcf10a4ed23a24bdd4040f6501f3b43562caf
404--- /dev/null
405+++ b/plugins/vagrant/vagrant.plugin.zsh
406@@ -0,0 +1,3 @@
407+fpath=($ZSH/plugins/vagrant $fpath)
408+autoload -U compinit
409+compinit -i
410diff --git a/themes/afowler.zsh-theme b/themes/afowler.zsh-theme
411index b5a9bb1730da771dd6cc253e1676e3382285b808..3a4753fc105f01c21e30d7886f887360cec74da7 100644
412--- a/themes/afowler.zsh-theme
413+++ b/themes/afowler.zsh-theme
414@@ -1,4 +1,4 @@
415-if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
416+if [ $UID -eq 0 ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
417
418 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
419
420diff --git a/themes/arrow.zsh-theme b/themes/arrow.zsh-theme
421index a23efd1d763e3f4fca4f488f7286958c76d0fe07..d62dcdcb9d7fc8cdb47206675dc9250d8efe6c96 100644
422--- a/themes/arrow.zsh-theme
423+++ b/themes/arrow.zsh-theme
424@@ -1,4 +1,4 @@
425-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
426+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
427
428 PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}'
429 RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}'
430diff --git a/themes/awesomepanda.zsh-theme b/themes/awesomepanda.zsh-theme
431new file mode 100644
432index 0000000000000000000000000000000000000000..411b898371ade495a7924e6cd871d8f442d13b82
433--- /dev/null
434+++ b/themes/awesomepanda.zsh-theme
435@@ -0,0 +1,18 @@
436+# the svn plugin has to be activated for this to work.
437+
438+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%}'
439+
440+ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
441+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
442+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%} ✗ %{$reset_color%}"
443+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) "
444+
445+
446+
447+ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}"
448+ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}"
449+
450+ZSH_THEME_SVN_PROMPT_PREFIX="svn:("
451+ZSH_THEME_SVN_PROMPT_SUFFIX=")"
452+ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}"
453+ZSH_THEME_SVN_PROMPT_CLEAN=" "
454diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
455new file mode 100644
456index 0000000000000000000000000000000000000000..f0ee6a5bded2ca01dc9dbf2bb6ca8f1890eb2b34
457--- /dev/null
458+++ b/themes/bira.zsh-theme
459@@ -0,0 +1,14 @@
460+# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
461+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
462+
463+local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
464+local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
465+local rvm_ruby='%{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v g)›%{$reset_color%}'
466+local git_branch='$(git_prompt_info)%{$reset_color%}'
467+
468+PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
469+╰─%B$%b "
470+RPS1="${return_code}"
471+
472+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
473+ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
474diff --git a/themes/clean.zsh-theme b/themes/clean.zsh-theme
475index 95f532a823f589722c35fe95e6ae282126b69d16..7ee29cb8ccea928eb93da029ba95b14fc18c4ffc 100644
476--- a/themes/clean.zsh-theme
477+++ b/themes/clean.zsh-theme
478@@ -1,4 +1,4 @@
479-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="white"; fi
480+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi
481
482 PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
483 RPROMPT='[%*]'
484diff --git a/themes/dieter.zsh-theme b/themes/dieter.zsh-theme
485new file mode 100644
486index 0000000000000000000000000000000000000000..0a5e9265bd680e628c2da9ae61b5ae37159d1214
487--- /dev/null
488+++ b/themes/dieter.zsh-theme
489@@ -0,0 +1,56 @@
490+# the idea of this theme is to contain a lot of info in a small string, by
491+# compressing some parts and colorcoding, which bring useful visual cues,
492+# while limiting the amount of colors and such to keep it easy on the eyes.
493+# When a command exited >0, the timestamp will be in red and the exit code
494+# will be on the right edge.
495+# The exit code visual cues will only display once.
496+# (i.e. they will be reset, even if you hit enter a few times on empty command prompts)
497+
498+typeset -A host_repr
499+
500+# translate hostnames into shortened, colorcoded strings
501+host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4")
502+
503+# local time, color coded by last return code
504+time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
505+time_disabled="%{$fg[green]%}%*%{$reset_color%}"
506+time=$time_enabled
507+
508+# user part, color coded by privileges
509+local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
510+
511+# Hostname part. compressed and colorcoded per host_repr array
512+# if not found, regular hostname in default color
513+local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}"
514+
515+# Compacted $PWD
516+local pwd="%{$fg[blue]%}%c%{$reset_color%}"
517+
518+PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)'
519+
520+# i would prefer 1 icon that shows the "most drastic" deviation from HEAD,
521+# but lets see how this works out
522+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}"
523+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
524+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}"
525+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
526+
527+# elaborate exitcode on the right when >0
528+return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
529+return_code_disabled=
530+return_code=$return_code_enabled
531+
532+RPS1='${return_code}'
533+
534+function accept-line-or-clear-warning () {
535+ if [[ -z $BUFFER ]]; then
536+ time=$time_disabled
537+ return_code=$return_code_disabled
538+ else
539+ time=$time_enabled
540+ return_code=$return_code_enabled
541+ fi
542+ zle accept-line
543+}
544+zle -N accept-line-or-clear-warning
545+bindkey '^M' accept-line-or-clear-warning
546diff --git a/themes/dst.zsh-theme b/themes/dst.zsh-theme
547index fa0d9cb06bf605df6a54f3db163e52e9c6e31176..3e2539d57592937a074e0c01e68bd76cf0d539d2 100644
548--- a/themes/dst.zsh-theme
549+++ b/themes/dst.zsh-theme
550@@ -5,7 +5,7 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
551 ZSH_THEME_GIT_PROMPT_CLEAN=""
552
553 function prompt_char {
554- if [ "$(whoami)" = "root" ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
555+ if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
556 }
557
558 PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%}
559diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme
560new file mode 100644
561index 0000000000000000000000000000000000000000..f22eda868501accc1aed45380a70d634eb8d0435
562--- /dev/null
563+++ b/themes/fishy.zsh-theme
564@@ -0,0 +1,9 @@
565+# ZSH Theme emulating the Fish shell's default prompt.
566+
567+local user_color='green'; [ $UID -eq 0 ] && user_color='red'
568+PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) '
569+PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
570+RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%})$(git_prompt_info)'
571+
572+ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}"
573+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
574diff --git a/themes/flazz.zsh-theme b/themes/flazz.zsh-theme
575new file mode 100644
576index 0000000000000000000000000000000000000000..280794f2b83c33bf3c039e2fdb3a868b92d55ca2
577--- /dev/null
578+++ b/themes/flazz.zsh-theme
579@@ -0,0 +1,19 @@
580+if [ "$(whoami)" = "root" ]
581+then CARETCOLOR="red"
582+else CARETCOLOR="blue"
583+fi
584+
585+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
586+
587+PROMPT='%m%{${fg_bold[magenta]}%} :: %{$reset_color%}%{${fg[green]}%}%3~ $(git_prompt_info)%{${fg_bold[$CARETCOLOR]}%}%#%{${reset_color}%} '
588+
589+RPS1='$(vi_mode_prompt_info) ${return_code}'
590+
591+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}‹"
592+ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
593+
594+MODE_INDICATOR="%{$fg_bold[magenta]%}<%{$reset_color%}%{$fg[magenta]%}<<%{$reset_color%}"
595+
596+# TODO use 265 colors
597+#MODE_INDICATOR="$FX[bold]$FG[020]<$FX[no_bold]%{$fg[blue]%}<<%{$reset_color%}"
598+# TODO use two lines if git
599diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme
600new file mode 100644
601index 0000000000000000000000000000000000000000..cba143d426d0dadd49d1d8a9be2e966501f5c580
602--- /dev/null
603+++ b/themes/gentoo.zsh-theme
604@@ -0,0 +1,4 @@
605+PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%#%{$reset_color%} '
606+
607+ZSH_THEME_GIT_PROMPT_PREFIX="("
608+ZSH_THEME_GIT_PROMPT_SUFFIX=") "
609diff --git a/themes/jreese.zsh-theme b/themes/jreese.zsh-theme
610index 534664f115e4c8b5bcd3af8eb360362ea6de6b6b..0fa6b4ecd5e85596e80e7cc1dd1894878aa0f7ac 100644
611--- a/themes/jreese.zsh-theme
612+++ b/themes/jreese.zsh-theme
613@@ -1,6 +1,6 @@
614 # ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png
615
616-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
617+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
618 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
619
620 PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \
621diff --git a/themes/kardan.zsh-theme b/themes/kardan.zsh-theme
622new file mode 100644
623index 0000000000000000000000000000000000000000..fd6586a9d70ce03e7fe20bdc7921d66b94e3576e
624--- /dev/null
625+++ b/themes/kardan.zsh-theme
626@@ -0,0 +1,12 @@
627+# Simple theme based on my old zsh settings.
628+
629+function get_host {
630+ echo '@'`hostname`''
631+}
632+
633+PROMPT='> '
634+RPROMPT='%~$(git_prompt_info)$(get_host)'
635+
636+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}✗%{$reset_color%}"
637+ZSH_THEME_GIT_PROMPT_PREFIX="("
638+ZSH_THEME_GIT_PROMPT_SUFFIX=")"
639diff --git a/themes/lambda.zsh-theme b/themes/lambda.zsh-theme
640new file mode 100644
641index 0000000000000000000000000000000000000000..63292d3314607a0abbabcc2ce0002d39b975f218
642--- /dev/null
643+++ b/themes/lambda.zsh-theme
644@@ -0,0 +1,6 @@
645+# ZSH Theme - Preview: http://cl.ly/350F0F0k1M2y3A2i3p1S
646+
647+PROMPT='λ %~/ $(git_prompt_info)%{$reset_color%}'
648+
649+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}"
650+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
651diff --git a/themes/philips.zsh-theme b/themes/philips.zsh-theme
652index fa7c590355a2a1fcd8b7c4d87ad19e9f234be2eb..e7ea51a2ff8202536a24790780064ecf0d6ade7f 100644
653--- a/themes/philips.zsh-theme
654+++ b/themes/philips.zsh-theme
655@@ -1,4 +1,4 @@
656-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
657+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
658
659 PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
660 RPROMPT='[%*]'
661diff --git a/themes/pmcgee.zsh-theme b/themes/pmcgee.zsh-theme
662index 4eb54df5baaf5922c19a801882359de3f737ef27..e4e45c71adfa23054eca9eb3daadda8856b6874c 100644
663--- a/themes/pmcgee.zsh-theme
664+++ b/themes/pmcgee.zsh-theme
665@@ -1,4 +1,4 @@
666-if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
667+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
668
669 PROMPT='
670 %{$fg[$NCOLOR]%}%B%n@%m%b%{$reset_color%} %{$fg[white]%}%B${PWD/#$HOME/~}%b%{$reset_color%}
671diff --git a/themes/rixius.zsh-theme b/themes/rixius.zsh-theme
672new file mode 100644
673index 0000000000000000000000000000000000000000..c0c5c9c718ad77d52876c8438903ad40069f24a9
674--- /dev/null
675+++ b/themes/rixius.zsh-theme
676@@ -0,0 +1,24 @@
677+# /|/ Code by Stephen
678+# /|/ "Rixius" Middleton
679+#
680+# name in folder (github)
681+# ± if in github repo, or ≥ if otherwise Time in 24-hour format is on right.
682+function collapse_pwd {
683+ echo $(pwd | sed -e "s,^$HOME,~,")
684+}
685+function prompt_char {
686+ echo -n "%{$bg[white]%}%{$fg[red]%}"
687+ git branch >/dev/null 2>/dev/null && echo "±%{$reset_color%}" && return
688+ echo "≥%{$reset_color%}"
689+}
690+RIXIUS_PRE="%{$bg[white]%}%{$fg[red]%}"
691+
692+PROMPT='
693+%{$RIXIUS_PRE%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)
694+$(prompt_char) '
695+RPROMPT='%{$RIXIUS_PRE%}%T%{$reset_color%}'
696+
697+ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
698+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
699+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RIXIUS_PRE%}!%{$reset_color%}"
700+ZSH_THEME_GIT_PROMPT_CLEAN=" %{$RIXIUS_PRE%}√%{$reset_color%}"
701diff --git a/themes/theunraveler.zsh-theme b/themes/theunraveler.zsh-theme
702index 4eec8e827d98b1f5df8a780bfe03e3f87de25d18..e4bfb79c5fb742a903e77178025998188b5a15b1 100644
703--- a/themes/theunraveler.zsh-theme
704+++ b/themes/theunraveler.zsh-theme
705@@ -1,6 +1,16 @@
706-# Comment
707+# Comment
708
709-ZSH_THEME_GIT_PROMPT_PREFIX=' (git:'
710-ZSH_THEME_GIT_PROMPT_SUFFIX=')'
711+PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}'
712
713-PROMPT='%{$fg[magenta]%}[%c]$(git_prompt_info) $ %{$reset_color%}'
714+RPROMPT='%{$fg[magenta]%}$(git_prompt_info)%{$reset_color%} $(git_prompt_status)%{$reset_color%}'
715+
716+ZSH_THEME_GIT_PROMPT_PREFIX=""
717+ZSH_THEME_GIT_PROMPT_SUFFIX=""
718+ZSH_THEME_GIT_PROMPT_DIRTY=""
719+ZSH_THEME_GIT_PROMPT_CLEAN=""
720+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈"
721+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭"
722+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗"
723+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦"
724+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂"
725+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱"