Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

updates

  • Loading branch information...
commit 5e8845fe8c304bbf628179b5768c3d6573c14221 1 parent 479bdc1
Luke van der Hoeven authored January 08, 2014

Showing 109 changed files with 1,909 additions and 589 deletions. Show diff stats Hide diff stats

  1. 6  home/.oh-my-zsh/.gitignore
  2. 33  home/.oh-my-zsh/README.textile
  3. 1  home/.oh-my-zsh/custom/aliases.zsh
  4. 16  home/.oh-my-zsh/lib/aliases.zsh
  5. 5  home/.oh-my-zsh/lib/completion.zsh
  6. 7  home/.oh-my-zsh/lib/correction.zsh
  7. 29  home/.oh-my-zsh/lib/directories.zsh
  8. 3  home/.oh-my-zsh/lib/edit-command-line.zsh
  9. 60  home/.oh-my-zsh/lib/functions.zsh
  10. 75  home/.oh-my-zsh/lib/git.zsh
  11. 4  home/.oh-my-zsh/lib/history.zsh
  12. 5  home/.oh-my-zsh/lib/key-bindings.zsh
  13. 4  home/.oh-my-zsh/lib/misc.zsh
  14. 9  home/.oh-my-zsh/lib/rvm.zsh
  15. 7  home/.oh-my-zsh/lib/spectrum.zsh
  16. 8  home/.oh-my-zsh/lib/termsupport.zsh
  17. 12  home/.oh-my-zsh/lib/theme-and-appearance.zsh
  18. 39  home/.oh-my-zsh/oh-my-zsh.sh
  19. 16  home/.oh-my-zsh/plugins/ant/ant.plugin.zsh
  20. 24  home/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh
  21. 10  home/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh
  22. 100  home/.oh-my-zsh/plugins/battery/battery.plugin.zsh
  23. 7  home/.oh-my-zsh/plugins/brew/_brew
  24. 9  home/.oh-my-zsh/plugins/bundler/_bundler
  25. 30  home/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh
  26. 11  home/.oh-my-zsh/plugins/cake/cake.plugin.zsh
  27. 6  home/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh
  28. 23  home/.oh-my-zsh/plugins/composer/composer.plugin.zsh
  29. 49  home/.oh-my-zsh/plugins/debian/debian.plugin.zsh
  30. 15  home/.oh-my-zsh/plugins/django/django.plugin.zsh
  31. 4  home/.oh-my-zsh/plugins/encode64/encode64.plugin.zsh
  32. 4  home/.oh-my-zsh/plugins/extract/extract.plugin.zsh
  33. 7  home/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh
  34. 11  home/.oh-my-zsh/plugins/gem/_gem
  35. 29  home/.oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh
  36. 105  home/.oh-my-zsh/plugins/git/git.plugin.zsh
  37. 18  home/.oh-my-zsh/plugins/github/github.plugin.zsh
  38. 51  home/.oh-my-zsh/plugins/gpg-agent/gpg-agent.plugin.zsh
  39. 19  home/.oh-my-zsh/plugins/gradle/gradle.plugin.zsh
  40. 28  home/.oh-my-zsh/plugins/grails/grails.plugin.zsh
  41. 7  home/.oh-my-zsh/plugins/heroku/_heroku
  42. 41  home/.oh-my-zsh/plugins/jira/jira.plugin.zsh
  43. 25  home/.oh-my-zsh/plugins/knife/_knife
  44. 14  home/.oh-my-zsh/plugins/lein/lein.plugin.zsh
  45. 1  home/.oh-my-zsh/plugins/lol/lol.plugin.zsh
  46. 52  home/.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh
  47. 172  home/.oh-my-zsh/plugins/mvn/mvn.plugin.zsh
  48. 10  home/.oh-my-zsh/plugins/node/node.plugin.zsh
  49. 100  home/.oh-my-zsh/plugins/osx/osx.plugin.zsh
  50. 7  home/.oh-my-zsh/plugins/per-directory-history/per-directory-history.plugin.zsh
  51. 11  home/.oh-my-zsh/plugins/phing/phing.plugin.zsh
  52. 11  home/.oh-my-zsh/plugins/pip/_pip
  53. 10  home/.oh-my-zsh/plugins/python/python.plugin.zsh
  54. 61  home/.oh-my-zsh/plugins/rails/rails.plugin.zsh
  55. 27  home/.oh-my-zsh/plugins/rails3/rails3.plugin.zsh
  56. 12  home/.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh
  57. 24  home/.oh-my-zsh/plugins/rvm/rvm.plugin.zsh
  58. 2  home/.oh-my-zsh/plugins/screen/screen.plugin.zsh
  59. 4  home/.oh-my-zsh/plugins/sprunge/sprunge.plugin.zsh
  60. 19  home/.oh-my-zsh/plugins/ssh-agent/ssh-agent.plugin.zsh
  61. 30  home/.oh-my-zsh/plugins/sublime/sublime.plugin.zsh
  62. 1  home/.oh-my-zsh/plugins/supervisor/_supervisord
  63. 68  home/.oh-my-zsh/plugins/suse/suse.plugin.zsh
  64. 88  home/.oh-my-zsh/plugins/svn/svn.plugin.zsh
  65. 10  home/.oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh
  66. 42  home/.oh-my-zsh/plugins/terminalapp/terminalapp.plugin.zsh
  67. 13  home/.oh-my-zsh/plugins/textmate/textmate.plugin.zsh
  68. 34  home/.oh-my-zsh/plugins/urltools/urltools.plugin.zsh
  69. 14  home/.oh-my-zsh/plugins/vagrant/_vagrant
  70. 20  home/.oh-my-zsh/plugins/vi-mode/vi-mode.plugin.zsh
  71. 95  home/.oh-my-zsh/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
  72. 6  home/.oh-my-zsh/plugins/vundle/vundle.plugin.zsh
  73. 12  home/.oh-my-zsh/plugins/zeus/README.md
  74. 23  home/.oh-my-zsh/plugins/zeus/zeus.plugin.zsh
  75. 37  home/.oh-my-zsh/templates/zshrc.zsh-template
  76. 2  home/.oh-my-zsh/themes/af-magic.zsh-theme
  77. 62  home/.oh-my-zsh/themes/agnoster.zsh-theme
  78. 16  home/.oh-my-zsh/themes/blinks.zsh-theme
  79. 6  home/.oh-my-zsh/themes/cloud.zsh-theme
  80. 2  home/.oh-my-zsh/themes/crunch.zsh-theme
  81. 4  home/.oh-my-zsh/themes/dallas.zsh-theme
  82. 2  home/.oh-my-zsh/themes/fino-time.zsh-theme
  83. 22  home/.oh-my-zsh/themes/fino.zsh-theme
  84. 11  home/.oh-my-zsh/themes/fishy.zsh-theme
  85. 6  home/.oh-my-zsh/themes/frisk.zsh-theme
  86. 4  home/.oh-my-zsh/themes/gallois.zsh-theme
  87. 6  home/.oh-my-zsh/themes/gentoo.zsh-theme
  88. 63  home/.oh-my-zsh/themes/jonathan.zsh-theme
  89. 2  home/.oh-my-zsh/themes/josh.zsh-theme
  90. 80  home/.oh-my-zsh/themes/linuxonly
  91. 2  home/.oh-my-zsh/themes/macovsky-ruby.zsh-theme
  92. 2  home/.oh-my-zsh/themes/macovsky.zsh-theme
  93. 25  home/.oh-my-zsh/themes/minimal.zsh-theme
  94. 3  home/.oh-my-zsh/themes/mortalscumbag.zsh-theme
  95. 2  home/.oh-my-zsh/themes/norm.zsh-theme
  96. 35  home/.oh-my-zsh/themes/pygmalion.zsh-theme
  97. 4  home/.oh-my-zsh/themes/rkj-repos.zsh-theme
  98. 5  home/.oh-my-zsh/themes/rkj.zsh-theme
  99. 3  home/.oh-my-zsh/themes/robbyrussell.zsh-theme
  100. 1  home/.oh-my-zsh/themes/smt.zsh-theme
  101. 22  home/.oh-my-zsh/themes/sunrise.zsh-theme
  102. 8  home/.oh-my-zsh/themes/superjarin.zsh-theme
  103. 5  home/.oh-my-zsh/themes/wedisagree.zsh-theme
  104. 34  home/.oh-my-zsh/themes/zhann.zsh-theme
  105. 10  home/.oh-my-zsh/tools/check_for_upgrade.sh
  106. 19  home/.oh-my-zsh/tools/install.sh
  107. 3  home/.oh-my-zsh/tools/theme_chooser.sh
  108. 18  home/.oh-my-zsh/tools/uninstall.sh
  109. 7  home/.oh-my-zsh/tools/upgrade.sh
6  home/.oh-my-zsh/.gitignore
... ...
@@ -1,9 +1,9 @@
1 1
 locals.zsh
2 2
 log/.zsh_history
3 3
 projects.zsh
4  
-!custom/*
5  
-custom/example
6  
-custom/example.zsh
  4
+custom/*
  5
+!custom/example
  6
+!custom/example.zsh
7 7
 *.swp
8 8
 !custom/example.zshcache
9 9
 cache/
33  home/.oh-my-zsh/README.textile
Source Rendered
... ...
@@ -1,5 +1,6 @@
1  
-A handful of functions, auto-complete helpers, and stuff that makes you shout...
  1
+!https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png!
2 2
 
  3
+oh-my-zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and few things that make you shout...
3 4
 
4 5
 bq. "OH MY ZSHELL!"
5 6
 
@@ -13,11 +14,11 @@ You can install this via the command line with either `curl` or `wget`.
13 14
 
14 15
 h4. via `curl`
15 16
 
16  
-@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@
  17
+@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh@
17 18
 
18 19
 h4. via `wget`
19 20
 
20  
-@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
  21
+@wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh@
21 22
 
22 23
 h3. The manual way
23 24
 
@@ -26,17 +27,20 @@ h3. The manual way
26 27
 
27 28
   @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
28 29
 
29  
-2. Create a new zsh config by copying the zsh template we've provided.
  30
+2. *OPTIONAL* Backup your existing ~/.zshrc file
30 31
 
31  
-  *NOTE*: If you already have a ~/.zshrc file, you should back it up. @cp ~/.zshrc ~/.zshrc.orig@ in case you want to go back to your original settings.
  32
+  @cp ~/.zshrc ~/.zshrc.orig@
  33
+
  34
+3. Create a new zsh config by copying the zsh template we've provided.
32 35
 
33 36
   @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
34 37
 
35  
-3. Set zsh as your default shell:
  38
+
  39
+4. Set zsh as your default shell:
36 40
 
37 41
   @chsh -s /bin/zsh@
38 42
 
39  
-4. Start / restart zsh (open a new terminal is easy enough...)
  43
+5. Start / restart zsh (open a new terminal is easy enough...)
40 44
 
41 45
 h3. Problems?
42 46
 
@@ -60,6 +64,17 @@ If you want to override any of the default behavior, just add a new file (ending
60 64
 If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
61 65
 If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
62 66
 
  67
+h3. Updates
  68
+
  69
+By default you will be prompted to check for updates. If you would like oh-my-zsh to automatically update itself without prompting you, set the following in your ~/.zshrc
  70
+
  71
+@DISABLE_UPDATE_PROMPT=true@
  72
+
  73
+To disable updates entirely, put this in your ~/.zshrc
  74
+
  75
+@DISABLE_AUTO_UPDATE=true@
  76
+
  77
+To upgrade directly from the command line, just run @upgrade_oh_my_zsh@
63 78
 
64 79
 h3. Uninstalling
65 80
 
@@ -73,9 +88,7 @@ h3. (Don't) Send us your theme! (for now)
73 88
 
74 89
 -I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.-
75 90
 
76  
-We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there. 
77  
-
78  
-
  91
+We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there.
79 92
 
80 93
 h2. Contributors
81 94
 
1  home/.oh-my-zsh/custom/aliases.zsh
@@ -33,7 +33,6 @@ alias ls='ls -G '
33 33
 alias offlineimap-tty='offlineimap -u TTY.TTYUI'
34 34
 alias hnb-partecs='hnb $HOME/partecs/partecs-hnb.xml'
35 35
 alias rest2html-css='rst2html --embed-stylesheet --stylesheet-path=/usr/share/python-docutils/s5_html/themes/default/print.css'
36  
-alias vim='/Applications/MacVim.app/Contents/MacOS/Vim'
37 36
 
38 37
 autoload -U edit-command-line
39 38
 zle -N edit-command-line
16  home/.oh-my-zsh/lib/aliases.zsh
@@ -8,16 +8,28 @@ alias -- -='cd -'
8 8
 
9 9
 # Super user
10 10
 alias _='sudo'
  11
+alias please='sudo'
11 12
 
12 13
 #alias g='grep -in'
13 14
 
14 15
 # Show history
15  
-alias history='fc -l 1'
16  
-
  16
+if [ "$HIST_STAMPS" = "mm/dd/yyyy" ]
  17
+then
  18
+    alias history='fc -fl 1'
  19
+elif [ "$HIST_STAMPS" = "dd.mm.yyyy" ]
  20
+then
  21
+    alias history='fc -El 1'
  22
+elif [ "$HIST_STAMPS" = "yyyy-mm-dd" ]
  23
+then
  24
+    alias history='fc -il 1'
  25
+else
  26
+    alias history='fc -l 1'
  27
+fi
17 28
 # List direcory contents
18 29
 alias lsa='ls -lah'
19 30
 alias l='ls -la'
20 31
 alias ll='ls -l'
  32
+alias la='ls -lA'
21 33
 alias sl=ls # often screw this up
22 34
 
23 35
 alias afind='ack-grep -il'
5  home/.oh-my-zsh/lib/completion.zsh
@@ -32,10 +32,12 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
32 32
 cdpath=(.)
33 33
 
34 34
 # use /etc/hosts and known_hosts for hostname completion
35  
-[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
  35
+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
36 36
 [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
  37
+[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=()
37 38
 [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
38 39
 hosts=(
  40
+  "$_ssh_config[@]"
39 41
   "$_global_ssh_hosts[@]"
40 42
   "$_ssh_hosts[@]"
41 43
   "$_etc_hosts[@]"
@@ -43,6 +45,7 @@ hosts=(
43 45
   localhost
44 46
 )
45 47
 zstyle ':completion:*:hosts' hosts $hosts
  48
+zstyle ':completion:*' users off
46 49
 
47 50
 # Use caching so that commands like apt and dpkg complete are useable
48 51
 zstyle ':completion::complete:*' use-cache 1
7  home/.oh-my-zsh/lib/correction.zsh
... ...
@@ -1,5 +1,3 @@
1  
-setopt correct_all
2  
-
3 1
 alias man='nocorrect man'
4 2
 alias mv='nocorrect mv'
5 3
 alias mysql='nocorrect mysql'
@@ -8,3 +6,8 @@ alias gist='nocorrect gist'
8 6
 alias heroku='nocorrect heroku'
9 7
 alias ebuild='nocorrect ebuild'
10 8
 alias hpodder='nocorrect hpodder'
  9
+alias sudo='nocorrect sudo'
  10
+
  11
+if [[ "$ENABLE_CORRECTION" == "true" ]]; then
  12
+  setopt correct_all
  13
+fi
29  home/.oh-my-zsh/lib/directories.zsh
@@ -2,6 +2,7 @@
2 2
 setopt auto_name_dirs
3 3
 setopt auto_pushd
4 4
 setopt pushd_ignore_dups
  5
+setopt pushdminus
5 6
 
6 7
 alias ..='cd ..'
7 8
 alias cd..='cd ..'
@@ -11,14 +12,14 @@ alias cd.....='cd ../../../..'
11 12
 alias cd/='cd /'
12 13
 
13 14
 alias 1='cd -'
14  
-alias 2='cd +2'
15  
-alias 3='cd +3'
16  
-alias 4='cd +4'
17  
-alias 5='cd +5'
18  
-alias 6='cd +6'
19  
-alias 7='cd +7'
20  
-alias 8='cd +8'
21  
-alias 9='cd +9'
  15
+alias 2='cd -2'
  16
+alias 3='cd -3'
  17
+alias 4='cd -4'
  18
+alias 5='cd -5'
  19
+alias 6='cd -6'
  20
+alias 7='cd -7'
  21
+alias 8='cd -8'
  22
+alias 9='cd -9'
22 23
 
23 24
 cd () {
24 25
   if   [[ "x$*" == "x..." ]]; then
@@ -26,9 +27,12 @@ cd () {
26 27
   elif [[ "x$*" == "x...." ]]; then
27 28
     cd ../../..
28 29
   elif [[ "x$*" == "x....." ]]; then
29  
-    cd ../../..
30  
-  elif [[ "x$*" == "x......" ]]; then
31 30
     cd ../../../..
  31
+  elif [[ "x$*" == "x......" ]]; then
  32
+    cd ../../../../..
  33
+  elif [ -d ~/.autoenv ]; then
  34
+    source ~/.autoenv/activate.sh
  35
+    autoenv_cd "$@"
32 36
   else
33 37
     builtin cd "$@"
34 38
   fi
@@ -37,8 +41,3 @@ cd () {
37 41
 alias md='mkdir -p'
38 42
 alias rd=rmdir
39 43
 alias d='dirs -v | head -10'
40  
-
41  
-# mkdir & cd to it
42  
-function mcd() { 
43  
-  mkdir -p "$1" && cd "$1"; 
44  
-}
3  home/.oh-my-zsh/lib/edit-command-line.zsh
... ...
@@ -1,3 +0,0 @@
1  
-autoload -U edit-command-line
2  
-zle -N edit-command-line
3  
-bindkey '\C-x\C-e' edit-command-line
60  home/.oh-my-zsh/lib/functions.zsh
... ...
@@ -1,5 +1,5 @@
1 1
 function zsh_stats() {
2  
-  history | awk '{print $2}' | sort | uniq -c | sort -rn | head
  2
+  history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl |  head -n20
3 3
 }
4 4
 
5 5
 function uninstall_oh_my_zsh() {
@@ -15,3 +15,61 @@ function take() {
15 15
   cd $1
16 16
 }
17 17
 
  18
+#
  19
+# Get the value of an alias.
  20
+#
  21
+# Arguments:
  22
+#    1. alias - The alias to get its value from
  23
+# STDOUT:
  24
+#    The value of alias $1 (if it has one).
  25
+# Return value:
  26
+#    0 if the alias was found,
  27
+#    1 if it does not exist
  28
+#
  29
+function alias_value() {
  30
+    alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
  31
+    test $(alias "$1")
  32
+}
  33
+
  34
+#
  35
+# Try to get the value of an alias,
  36
+# otherwise return the input.
  37
+#
  38
+# Arguments:
  39
+#    1. alias - The alias to get its value from
  40
+# STDOUT:
  41
+#    The value of alias $1, or $1 if there is no alias $1.
  42
+# Return value:
  43
+#    Always 0
  44
+#
  45
+function try_alias_value() {
  46
+    alias_value "$1" || echo "$1"
  47
+}
  48
+
  49
+#
  50
+# Set variable "$1" to default value "$2" if "$1" is not yet defined.
  51
+#
  52
+# Arguments:
  53
+#    1. name - The variable to set
  54
+#    2. val  - The default value 
  55
+# Return value:
  56
+#    0 if the variable exists, 3 if it was set
  57
+#
  58
+function default() {
  59
+    test `typeset +m "$1"` && return 0
  60
+    typeset -g "$1"="$2"   && return 3
  61
+}
  62
+
  63
+#
  64
+# Set enviroment variable "$1" to default value "$2" if "$1" is not yet defined.
  65
+#
  66
+# Arguments:
  67
+#    1. name - The env variable to set
  68
+#    2. val  - The default value 
  69
+# Return value:
  70
+#    0 if the env variable exists, 3 if it was set
  71
+#
  72
+function env_default() {
  73
+    env | grep -q "^$1=" && return 0 
  74
+    export "$1=$2"       && return 3
  75
+}
75  home/.oh-my-zsh/lib/git.zsh
... ...
@@ -1,46 +1,79 @@
1 1
 # get the name of the branch we are on
2 2
 function git_prompt_info() {
3  
-  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
4  
-  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
  3
+  if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
  4
+    ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
  5
+    ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
  6
+    echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
  7
+  fi
5 8
 }
6 9
 
7 10
 
8 11
 # Checks if working tree is dirty
9 12
 parse_git_dirty() {
10 13
   local SUBMODULE_SYNTAX=''
11  
-  if [[ $POST_1_7_2_GIT -gt 0 ]]; then
12  
-        SUBMODULE_SYNTAX="--ignore-submodules=dirty"
13  
-  fi
14  
-  if [[ -n $(git status -s ${SUBMODULE_SYNTAX}  2> /dev/null) ]]; then
15  
-    echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
  14
+  local GIT_STATUS=''
  15
+  local CLEAN_MESSAGE='nothing to commit (working directory clean)'
  16
+  if [[ "$(command git config --get oh-my-zsh.hide-status)" != "1" ]]; then
  17
+    if [[ $POST_1_7_2_GIT -gt 0 ]]; then
  18
+          SUBMODULE_SYNTAX="--ignore-submodules=dirty"
  19
+    fi
  20
+    if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
  21
+        GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
  22
+    else
  23
+        GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
  24
+    fi
  25
+    if [[ -n $GIT_STATUS ]]; then
  26
+      echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
  27
+    else
  28
+      echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
  29
+    fi
16 30
   else
17 31
     echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
18 32
   fi
19 33
 }
20 34
 
  35
+# get the difference between the local and remote branches
  36
+git_remote_status() {
  37
+    remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
  38
+    if [[ -n ${remote} ]] ; then
  39
+        ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
  40
+        behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
  41
+
  42
+        if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
  43
+        then
  44
+            echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
  45
+        elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
  46
+        then
  47
+            echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
  48
+        elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
  49
+        then
  50
+            echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
  51
+        fi
  52
+    fi
  53
+}
21 54
 
22 55
 # Checks if there are commits ahead from remote
23 56
 function git_prompt_ahead() {
24  
-  if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
  57
+  if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
25 58
     echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
26 59
   fi
27 60
 }
28 61
 
29 62
 # Formats prompt string for current git commit short SHA
30 63
 function git_prompt_short_sha() {
31  
-  SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
  64
+  SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
32 65
 }
33 66
 
34 67
 # Formats prompt string for current git commit long SHA
35 68
 function git_prompt_long_sha() {
36  
-  SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
  69
+  SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
37 70
 }
38 71
 
39 72
 # Get the status of the working tree
40 73
 git_prompt_status() {
41  
-  INDEX=$(git status --porcelain 2> /dev/null)
  74
+  INDEX=$(command git status --porcelain -b 2> /dev/null)
42 75
   STATUS=""
43  
-  if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
  76
+  if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then
44 77
     STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
45 78
   fi
46 79
   if $(echo "$INDEX" | grep '^A  ' &> /dev/null); then
@@ -60,23 +93,37 @@ git_prompt_status() {
60 93
   fi
61 94
   if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
62 95
     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
  96
+  elif $(echo "$INDEX" | grep '^D  ' &> /dev/null); then
  97
+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
63 98
   elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
64 99
     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
65 100
   fi
  101
+  if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
  102
+    STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
  103
+  fi
66 104
   if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
67 105
     STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
68 106
   fi
  107
+  if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
  108
+    STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
  109
+  fi
  110
+  if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
  111
+    STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
  112
+  fi
  113
+  if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
  114
+    STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
  115
+  fi
69 116
   echo $STATUS
70 117
 }
71 118
 
72 119
 #compare the provided version of git to the version installed and on path
73 120
 #prints 1 if input version <= installed version
74  
-#prints -1 otherwise 
  121
+#prints -1 otherwise
75 122
 function git_compare_version() {
76 123
   local INPUT_GIT_VERSION=$1;
77 124
   local INSTALLED_GIT_VERSION
78 125
   INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
79  
-  INSTALLED_GIT_VERSION=($(git --version));
  126
+  INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null));
80 127
   INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
81 128
 
82 129
   for i in {1..3}; do
4  home/.oh-my-zsh/lib/history.zsh
... ...
@@ -1,5 +1,7 @@
1 1
 ## Command history configuration
2  
-HISTFILE=$HOME/.zsh_history
  2
+if [ -z $HISTFILE ]; then
  3
+    HISTFILE=$HOME/.zsh_history
  4
+fi
3 5
 HISTSIZE=10000
4 6
 SAVEHIST=10000
5 7
 
5  home/.oh-my-zsh/lib/key-bindings.zsh
@@ -30,6 +30,11 @@ bindkey "^[[3~" delete-char
30 30
 bindkey "^[3;5~" delete-char
31 31
 bindkey "\e[3~" delete-char
32 32
 
  33
+# Edit the current command line in $EDITOR
  34
+autoload -U edit-command-line
  35
+zle -N edit-command-line
  36
+bindkey '\C-x\C-e' edit-command-line
  37
+
33 38
 # consider emacs keybindings:
34 39
 
35 40
 #bindkey -e  ## emacs key bindings
4  home/.oh-my-zsh/lib/misc.zsh
@@ -9,5 +9,7 @@ bindkey "^[m" copy-prev-shell-word
9 9
 setopt long_list_jobs
10 10
 
11 11
 ## pager
12  
-export PAGER="less -R"
  12
+export PAGER="less"
  13
+export LESS="-R"
  14
+
13 15
 export LC_CTYPE=$LANG
9  home/.oh-my-zsh/lib/rvm.zsh
... ...
@@ -1,5 +1,8 @@
1  
-# get the name of the branch we are on
  1
+# get the name of the ruby version
2 2
 function rvm_prompt_info() {
3  
-  ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return
4  
-  [[ ! -z $ruby_version ]] && echo "($ruby_version)"
  3
+  [ -f $HOME/.rvm/bin/rvm-prompt ] || return
  4
+  local rvm_prompt
  5
+  rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
  6
+  [[ "${rvm_prompt}x" == "x" ]] && return
  7
+  echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
5 8
 }
7  home/.oh-my-zsh/lib/spectrum.zsh
@@ -26,3 +26,10 @@ function spectrum_ls() {
26 26
   done
27 27
 }
28 28
 
  29
+# Show all 256 colors where the background is set to specific color
  30
+function spectrum_bls() {
  31
+  for code in {000..255}; do
  32
+    ((cc = code + 1))
  33
+    print -P -- "$BG[$code]$code: Test %{$reset_color%}"
  34
+  done
  35
+}
8  home/.oh-my-zsh/lib/termsupport.zsh
@@ -8,7 +8,7 @@ function title {
8 8
   fi
9 9
   if [[ "$TERM" == screen* ]]; then
10 10
     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
11  
-  elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
  11
+  elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
12 12
     print -Pn "\e]2;$2:q\a" #set window name
13 13
     print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
14 14
   fi
@@ -26,8 +26,10 @@ function omz_termsupport_precmd {
26 26
 function omz_termsupport_preexec {
27 27
   emulate -L zsh
28 28
   setopt extended_glob
29  
-  local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
30  
-  title "$CMD" "%100>...>$2%<<"
  29
+  local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
  30
+  local LINE="${2:gs/$/\\$}"
  31
+  LINE="${LINE:gs/%/%%}"
  32
+  title "$CMD" "%100>...>$LINE%<<"
31 33
 }
32 34
 
33 35
 autoload -U add-zsh-hook
12  home/.oh-my-zsh/lib/theme-and-appearance.zsh
@@ -7,7 +7,17 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
7 7
 if [ "$DISABLE_LS_COLORS" != "true" ]
8 8
 then
9 9
   # Find the option for using colors in ls, depending on the version: Linux or BSD
10  
-  ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
  10
+  if [[ "$(uname -s)" == "NetBSD" ]]; then
  11
+    # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors); 
  12
+    # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
  13
+    gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
  14
+  elif [[ "$(uname -s)" == "OpenBSD" ]]; then
  15
+    # On OpenBSD, test if "colorls" is installed (this one supports colors);
  16
+    # otherwise, leave ls as is, because OpenBSD's ls doesn't support -G
  17
+    colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
  18
+  else
  19
+    ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
  20
+  fi
11 21
 fi
12 22
 
13 23
 #setopt no_beep
39  home/.oh-my-zsh/oh-my-zsh.sh
... ...
@@ -1,7 +1,6 @@
1 1
 # Check for updates on initial load...
2  
-if [ "$DISABLE_AUTO_UPDATE" != "true" ]
3  
-then
4  
-  /usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh
  2
+if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
  3
+  /usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh $ZSH/tools/check_for_upgrade.sh
5 4
 fi
6 5
 
7 6
 # Initializes Oh My Zsh
@@ -11,7 +10,9 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
11 10
 
12 11
 # Load all of the config files in ~/oh-my-zsh that end in .zsh
13 12
 # TIP: Add files you don't want in git to .gitignore
14  
-for config_file ($ZSH/lib/*.zsh) source $config_file
  13
+for config_file ($ZSH/lib/*.zsh); do
  14
+  source $config_file
  15
+done
15 16
 
16 17
 # Set ZSH_CUSTOM to the path where your custom config files
17 18
 # and plugins exists, or else we will use the default custom/
@@ -36,10 +37,20 @@ for plugin ($plugins); do
36 37
   fi
37 38
 done
38 39
 
  40
+# Figure out the SHORT hostname
  41
+if [ -n "$commands[scutil]" ]; then
  42
+  # OS X
  43
+  SHORT_HOST=$(scutil --get ComputerName)
  44
+else
  45
+  SHORT_HOST=${HOST/.*/}
  46
+fi
  47
+
  48
+# Save the location of the current completion dump file.
  49
+ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
  50
+
39 51
 # Load and run compinit
40 52
 autoload -U compinit
41  
-compinit -i
42  
-
  53
+compinit -i -d "${ZSH_COMPDUMP}"
43 54
 
44 55
 # Load all of the plugins that were defined in ~/.zshrc
45 56
 for plugin ($plugins); do
@@ -51,11 +62,13 @@ for plugin ($plugins); do
51 62
 done
52 63
 
53 64
 # Load all of your custom configurations from custom/
54  
-for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
  65
+for config_file ($ZSH_CUSTOM/*.zsh(N)); do
  66
+  source $config_file
  67
+done
  68
+unset config_file
55 69
 
56 70
 # Load the theme
57  
-if [ "$ZSH_THEME" = "random" ]
58  
-then
  71
+if [ "$ZSH_THEME" = "random" ]; then
59 72
   themes=($ZSH/themes/*zsh-theme)
60 73
   N=${#themes[@]}
61 74
   ((N=(RANDOM%N)+1))
@@ -63,11 +76,11 @@ then
63 76
   source "$RANDOM_THEME"
64 77
   echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
65 78
 else
66  
-  if [ ! "$ZSH_THEME" = ""  ]
67  
-  then
68  
-    if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]
69  
-    then
  79
+  if [ ! "$ZSH_THEME" = ""  ]; then
  80
+    if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
70 81
       source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
  82
+    elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
  83
+      source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
71 84
     else
72 85
       source "$ZSH/themes/$ZSH_THEME.zsh-theme"
73 86
     fi
16  home/.oh-my-zsh/plugins/ant/ant.plugin.zsh
... ...
@@ -1,17 +1,7 @@
1  
-stat -f%m . > /dev/null 2>&1
2  
-if [ "$?" = 0 ]; then
3  
-	stat_cmd=(stat -f%m)
4  
-else
5  
-	stat_cmd=(stat -L --format=%Y)
6  
-fi
7  
-
8 1
 _ant_does_target_list_need_generating () {
9  
-  if [ ! -f .ant_targets ]; then return 0;
10  
-  else
11  
-    accurate=$($stat_cmd .ant_targets)
12  
-    changed=$($stat_cmd build.xml)
13  
-    return $(expr $accurate '>=' $changed)
14  
-  fi
  2
+  [ ! -f .ant_targets ] && return 0;
  3
+  [ .ant_targets -nt build.xml ] && return 0;
  4
+  return 1;
15 5
 }
16 6
 
17 7
 _ant () {
24  home/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh
@@ -8,16 +8,18 @@ if [[ -x `which yaourt` ]]; then
8 8
   }
9 9
   alias yaconf='yaourt -C'        # Fix all configuration files with vimdiff
10 10
   # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
11  
-  alias yaupg='yaourt -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
  11
+  alias yaupg='yaourt -Syua'        # Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system.
12 12
   alias yasu='yaourt --sucre'      # Same as yaupg, but without confirmation
13 13
   alias yain='yaourt -S'           # Install specific package(s) from the repositories
14  
-  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file 
  14
+  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file
15 15
   alias yare='yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
16 16
   alias yarem='yaourt -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
17 17
   alias yarep='yaourt -Si'         # Display information about a given package in the repositories
18 18
   alias yareps='yaourt -Ss'        # Search for package(s) in the repositories
19 19
   alias yaloc='yaourt -Qi'         # Display information about a given package in the local database
20 20
   alias yalocs='yaourt -Qs'        # Search for package(s) in the local database
  21
+  alias yalst='yaourt -Qe'         # List installed packages, even those installed from AUR (they're tagged as "local")
  22
+  alias yaorph='yaourt -Qtd'       # Remove orphans using yaourt
21 23
   # Additional yaourt alias examples
22 24
   if [[ -x `which abs` ]]; then
23 25
     alias yaupd='yaourt -Sy && sudo abs'   # Update and refresh the local package and ABS databases against repositories
@@ -35,7 +37,7 @@ fi
35 37
 # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
36 38
 alias pacupg='sudo pacman -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
37 39
 alias pacin='sudo pacman -S'           # Install specific package(s) from the repositories
38  
-alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file 
  40
+alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file
39 41
 alias pacre='sudo pacman -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
40 42
 alias pacrem='sudo pacman -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
41 43
 alias pacrep='pacman -Si'              # Display information about a given package in the repositories
@@ -75,3 +77,19 @@ pacdisowned() {
75 77
 
76 78
   comm -23 "$fs" "$db"
77 79
 }
  80
+
  81
+pacmanallkeys() {
  82
+  # Get all keys for developers and trusted users
  83
+  curl https://www.archlinux.org/{developers,trustedusers}/ |
  84
+  awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
  85
+  xargs sudo pacman-key --recv-keys
  86
+}
  87
+
  88
+pacmansignkeys() {
  89
+  for key in $*; do
  90
+    sudo pacman-key --recv-keys $key
  91
+    sudo pacman-key --lsign-key $key
  92
+    printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
  93
+      --no-permission-warning --command-fd 0 --edit-key $key
  94
+  done
  95
+}
10  home/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh
@@ -3,9 +3,15 @@ if [ $commands[autojump] ]; then # check if autojump is installed
3 3
     . /usr/share/autojump/autojump.zsh
4 4
   elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
5 5
     . /etc/profile.d/autojump.zsh
  6
+  elif [ -f /etc/profile.d/autojump.sh ]; then # gentoo installation
  7
+    . /etc/profile.d/autojump.sh
  8
+  elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
  9
+    . /usr/local/share/autojump/autojump.zsh
  10
+  elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
  11
+    . $HOME/.autojump/etc/profile.d/autojump.zsh
6 12
   elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
7 13
     . /opt/local/etc/profile.d/autojump.zsh
8  
-  elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
9  
-    . `brew --prefix`/etc/autojump
  14
+  elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
  15
+    . `brew --prefix`/etc/autojump.zsh
10 16
   fi
11 17
 fi
100  home/.oh-my-zsh/plugins/battery/battery.plugin.zsh
... ...
@@ -1,20 +1,92 @@
1  
-if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
2  
-  function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
3  
-  function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
  1
+###########################################
  2
+# Battery plugin for oh-my-zsh            #
  3
+# Original Author: Peter hoeg (peterhoeg) #
  4
+# Email: peter@speartail.com              #
  5
+###########################################
  6
+# Author: Sean Jones (neuralsandwich)     #
  7
+# Email: neuralsandwich@gmail.com         #
  8
+# Modified to add support for Apple Mac   #
  9
+###########################################
  10
+
  11
+if [[ $(uname) == "Darwin" ]] ; then
  12
+
  13
+  function battery_pct() {
  14
+    typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
  15
+    typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
  16
+    integer i=$(((currentcapacity/maxcapacity) * 100))
  17
+    echo $i
  18
+  }
  19
+  
  20
+  function battery_pct_remaining() {
  21
+    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
  22
+      battery_pct
  23
+    else
  24
+      echo "External Power"
  25
+    fi
  26
+  }
  27
+
  28
+  function battery_time_remaining() {
  29
+    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
  30
+      timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
  31
+      echo "~$((timeremaining / 60)):$((timeremaining % 60))"
  32
+    else
  33
+      echo "∞"
  34
+    fi
  35
+  }
  36
+
  37
+  function battery_pct_prompt () {
  38
+    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
  39
+      b=$(battery_pct_remaining)
  40
+      if [ $b -gt 50 ] ; then
  41
+        color='green'
  42
+      elif [ $b -gt 20 ] ; then
  43
+        color='yellow'
  44
+      else
  45
+        color='red'
  46
+      fi
  47
+      echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
  48
+    else
  49
+      echo "∞"
  50
+    fi
  51
+  }
  52
+
  53
+elif [[ $(uname) == "Linux"  ]] ; then
  54
+
  55
+  function battery_pct_remaining() {
  56
+    if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
  57
+      echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" 
  58
+    fi
  59
+  }
  60
+
  61
+  function battery_time_remaining() {
  62
+    if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
  63
+      echo $(acpi | cut -f3 -d ',')
  64
+    fi
  65
+  }
  66
+
4 67
   function battery_pct_prompt() {
5  
-    b=$(battery_pct_remaining)
6  
-    if [ $b -gt 50 ] ; then
7  
-      color='green'
8  
-    elif [ $b -gt 20 ] ; then
9  
-      color='yellow'
  68
+    b=$(battery_pct_remaining) 
  69
+    if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
  70
+      if [ $b -gt 50 ] ; then
  71
+        color='green'
  72
+      elif [ $b -gt 20 ] ; then
  73
+        color='yellow'
  74
+      else
  75
+        color='red'
  76
+      fi
  77
+      echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
10 78
     else
11  
-      color='red'
  79
+      echo "∞"
12 80
     fi
13  
-    echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
14 81
   }
15 82
 else
16  
-  error_msg='no battery'
17  
-  function battery_pct_remaining() { echo $error_msg }
18  
-  function battery_time_remaining() { echo $error_msg }
19  
-  function battery_pct_prompt() { echo '' }
  83
+	# Empty functions so we don't cause errors in prompts
  84
+	function battery_pct_remaining() {
  85
+	}
  86
+
  87
+	function battery_time_remaining() {
  88
+	}
  89
+
  90
+	function battery_pct_prompt() {
  91
+	}
20 92
 fi
7  home/.oh-my-zsh/plugins/brew/_brew
@@ -26,8 +26,10 @@ _1st_arguments=(
26 26
   'list:list files in a formula or not-installed formulae'
27 27
   'log:git commit log for a formula'
28 28
   'missing:check all installed formuale for missing dependencies.'
  29
+  'options:display install options specific to formula.'
29 30
   'outdated:list formulas for which a newer version is available'
30 31
   'prune:remove dead links'
  32
+  'reinstall:reinstall a formula'
31 33
   'remove:remove a formula'
32 34
   'search:search for a formula (/regex/ or string)'
33 35
   'server:start a local web app that lets you browse formulae (requires Sinatra)'
@@ -35,6 +37,7 @@ _1st_arguments=(
35 37
   'update:freshen up links'
36 38
   'upgrade:upgrade outdated formulae'
37 39
   'uses:show formulas which depend on a formula'
  40
+  'versions:show all available formula versions'
38 41
 )
39 42
 
40 43
 local expl
@@ -71,10 +74,10 @@ case "$words[1]" in
71 74
         _brew_installed_formulae
72 75
         _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
73 76
       fi ;;
74  
-  install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
  77
+  install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
75 78
     _brew_all_formulae
76 79
     _wanted formulae expl 'all formulae' compadd -a formulae ;;
77  
-  remove|rm|uninstall|unlink|cleanup|link|ln)
  80
+  reinstall|remove|rm|uninstall|unlink|cleanup|link|ln)
78 81
     _brew_installed_formulae
79 82
     _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
80 83
 esac
9  home/.oh-my-zsh/plugins/bundler/_bundler
@@ -23,6 +23,7 @@ case $state in
23 23
 			"viz[Generate a visual representation of your dependencies]" \
24 24
 			"init[Generate a simple Gemfile, placed in the current directory]" \
25 25
 			"gem[Create a simple gem, suitable for development with bundler]" \
  26
+			"clean[Cleans up unused gems in your bundler directory]" \
26 27
 			"help[Describe available tasks or one specific task]"
27 28
 		ret=0
28 29
 		;;
@@ -62,6 +63,14 @@ case $state in
62 63
 			exec)
63 64
 				_normal && ret=0
64 65
 				;;
  66
+			clean)
  67
+				_arguments \
  68
+					'(--force)--force[forces clean even if --path is not set]' \
  69
+					'(--dry-run)--dry-run[only print out changes, do not actually clean gems]' \
  70
+					'(--no-color)--no-color[Disable colorization in output]' \
  71
+					'(--verbose)--verbose[Enable verbose output mode]'
  72
+				ret=0
  73
+				;;
65 74
 			(open|show)
66 75
 				_gems=( $(bundle show 2> /dev/null | sed -e '/^  \*/!d; s/^  \* \([^ ]*\) .*/\1/') )
67 76
 				if [[ $_gems != "" ]]; then
30  home/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh
... ...
@@ -1,15 +1,39 @@
1 1
 alias be="bundle exec"
2  
-alias bi="bundle install"
3 2
 alias bl="bundle list"
4 3
 alias bp="bundle package"
  4
+alias bo="bundle open"
5 5
 alias bu="bundle update"
6 6
 
7 7
 # The following is based on https://github.com/gma/bundler-exec
8 8
 
9  
-bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma)
  9
+bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails puma)
  10
+
  11
+# Remove $UNBUNDLED_COMMANDS from the bundled_commands list
  12
+for cmd in $UNBUNDLED_COMMANDS; do
  13
+  bundled_commands=(${bundled_commands#$cmd});
  14
+done
10 15
 
11 16
 ## Functions
12 17
 
  18
+bi() {
  19
+  if _bundler-installed && _within-bundled-project; then
  20
+    local bundler_version=`bundle version | cut -d' ' -f3`
  21
+    if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
  22
+      if [[ "$(uname)" == 'Darwin' ]]
  23
+      then
  24
+        local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
  25
+      else
  26
+        local cores_num="$(nproc)"
  27
+      fi
  28
+      bundle install --jobs=$cores_num $@
  29
+    else
  30
+      bundle install $@
  31
+    fi
  32
+  else
  33
+    echo "Can't 'bundle install' outside a bundled project"
  34
+  fi
  35
+}
  36
+
13 37
 _bundler-installed() {
14 38
   which bundle > /dev/null 2>&1
15 39
 }
@@ -33,6 +57,7 @@ _run-with-bundler() {
33 57
 
34 58
 ## Main program
35 59
 for cmd in $bundled_commands; do
  60
+  eval "function unbundled_$cmd () { $cmd \$@ }"
36 61
   eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
37 62
   alias $cmd=bundled_$cmd
38 63
 
@@ -40,3 +65,4 @@ for cmd in $bundled_commands; do
40 65
         compdef _$cmd bundled_$cmd=$cmd
41 66
   fi
42 67
 done
  68
+
11  home/.oh-my-zsh/plugins/cake/cake.plugin.zsh
@@ -14,12 +14,9 @@ _cake_does_target_list_need_generating () {
14 14
 		return 1;
15 15
 	fi
16 16
 
17  
-	if [ ! -f ${_cake_task_cache_file} ]; then return 0;
18  
-	else
19  
-		accurate=$(stat -f%m $_cake_task_cache_file)
20  
-		changed=$(stat -f%m Cakefile)
21  
-		return $(expr $accurate '>=' $changed)
22  
-	fi
  17
+	[ ! -f ${_cake_task_cache_file} ] && return 0;
  18
+	[ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
  19
+	return 1;
23 20
 }
24 21
 
25 22
 _cake () {
@@ -33,4 +30,4 @@ _cake () {
33 30
 	fi
34 31
 }
35 32
 
36  
-compdef _cake cake
  33
+compdef _cake cake
6  home/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh
@@ -2,4 +2,8 @@
2 2
 # as seen in http://www.porcheron.info/command-not-found-for-zsh/
3 3
 # this is installed in Ubuntu
4 4
 
5  
-source /etc/zsh_command_not_found
  5
+[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
  6
+
  7
+# Arch Linux command-not-found support, you must have package pkgfile installed
  8
+# https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook
  9
+[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh
23  home/.oh-my-zsh/plugins/composer/composer.plugin.zsh
@@ -10,9 +10,27 @@ _composer_get_command_list () {
10 10
 	composer --no-ansi | sed "1,/Available commands/d" | awk '/^  [a-z]+/ { print $1 }'
11 11
 }
12 12
 
  13
+_composer_get_required_list () {
  14
+    composer show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
  15
+}
  16
+
13 17
 _composer () {
  18
+  local curcontext="$curcontext" state line
  19
+  typeset -A opt_args
  20
+  _arguments \
  21
+    '1: :->command'\
  22
+    '*: :->args'
14 23
   if [ -f composer.json ]; then
15  
-    compadd `_composer_get_command_list`
  24
+    case $state in
  25
+      command)
  26
+        compadd `_composer_get_command_list`
  27
+        ;;
  28
+      *)
  29
+        compadd `_composer_get_required_list`
  30
+        ;;
  31
+    esac
  32
+  else
  33
+    compadd create-project init search selfupdate show
16 34
   fi
17 35
 }
18 36
 
@@ -24,6 +42,7 @@ alias csu='composer self-update'
24 42
 alias cu='composer update'
25 43
 alias ci='composer install'
26 44
 alias ccp='composer create-project'
  45
+alias cdu='composer dump-autoload'
27 46
 
28 47
 # install composer in the current directory
29  
-alias cget='curl -s https://getcomposer.org/installer | php'
  48
+alias cget='curl -s https://getcomposer.org/installer | php'
49  home/.oh-my-zsh/plugins/debian/debian.plugin.zsh
... ...
@@ -1,19 +1,20 @@
1 1
 # Authors:
2 2
 # https://github.com/AlexBio
3 3
 # https://github.com/dbb
  4
+# https://github.com/Mappleconfusers
4 5
 #
5 6
 # Debian-related zsh aliases and functions for zsh
6 7
 
7 8
 # Use aptitude if installed, or apt-get if not.
8 9
 # You can just set apt_pref='apt-get' to override it.
9  
-if [[ -e $( which aptitude ) ]]; then
  10
+if [[ -e $( which -p aptitude 2>&1 ) ]]; then
10 11
     apt_pref='aptitude'
11 12
 else
12 13
     apt_pref='apt-get'
13 14
 fi
14 15
 
15 16
 # Use sudo by default if it's installed
16  
-if [[ -e $( which sudo ) ]]; then
  17
+if [[ -e $( which -p sudo 2>&1 ) ]]; then
17 18
     use_sudo=1
18 19
 fi
19 20
 
@@ -21,7 +22,7 @@ fi
21 22
 # These are for more obscure uses of apt-get and aptitude that aren't covered
22 23
 # below.
23 24
 alias ag='apt-get'
24  
-alias at='aptitude'
  25
+alias ap='aptitude'
25 26
 
26 27
 # Some self-explanatory aliases
27 28
 alias acs="apt-cache search"
@@ -35,7 +36,7 @@ alias afs='apt-file search --regexp'
35 36
 
36 37
 # These are apt-get only
37 38
 alias asrc='apt-get source'
38  
-alias ap='apt-cache policy'
  39
+alias app='apt-cache policy'
39