d340bfab3345a223114b09d589356ff18a1a3efd

Author
Daniel Schauenberg <d@unwiredcouch.com>
Committer
Daniel Schauenberg <d@unwiredcouch.com>
Date

Message

Merge remote branch 'origin/master' into restructure_plugins

Diff

  1diff --git a/lib/completion.zsh b/lib/completion.zsh
  2index cba90179f28d31ba24c1c4ca77b76e6485632d2c..52cc5b53c0fe14d4b65953d04cee4342122794de 100644
  3--- a/lib/completion.zsh
  4+++ b/lib/completion.zsh
  5@@ -1,4 +1,4 @@
  6-## fixme - the load process here seems a bit bizarre
  7+# fixme - the load process here seems a bit bizarre
  8 
  9 unsetopt menu_complete   # do not autoselect the first completion entry
 10 unsetopt flowcontrol
 11@@ -30,6 +30,11 @@ zstyle ':completion:*:*:*:*:*' menu select
 12 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
 13 zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
 14 
 15+# disable named-directories autocompletion
 16+zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
 17+cdpath=(.)
 18+
 19+
 20 # Load known hosts file for auto-completion with ssh and scp commands
 21 if [ -f ~/.ssh/known_hosts ]; then
 22   zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
 23diff --git a/lib/functions.zsh b/lib/functions.zsh
 24index fcbe994be3ef9f7a483b2b7e86e9fa5cf265bcfb..561586cba657cb274f76b6a7a87743e154f006e4 100644
 25--- a/lib/functions.zsh
 26+++ b/lib/functions.zsh
 27@@ -5,7 +5,7 @@ function title {
 28     print -nR $'\033k'$1$'\033'\\\
 29 
 30     print -nR $'\033]0;'$2$'\a'
 31-  elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then
 32+  elif [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then
 33     # Use this one instead for XTerms:
 34     print -nR $'\033]0;'$*$'\a'
 35   fi
 36diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
 37index 2e282d66a85662e64e02444bdc97b0d72e7aa490..7196a88ffe3de7e8b1f4e8327ed58f050f8898b8 100644
 38--- a/lib/key-bindings.zsh
 39+++ b/lib/key-bindings.zsh
 40@@ -20,6 +20,7 @@ bindkey "^[[F"  end-of-line
 41 bindkey "^[[4~" end-of-line
 42 bindkey ' ' magic-space    # also do history expansion on space
 43 
 44+bindkey '^[[Z' reverse-menu-complete
 45 
 46 # consider emacs keybindings:
 47 
 48diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 49index bb45c71eb6f47fc2d082f64c827dc3ff11ac2a5b..848e48eb5e7002391a4a352c8bd7828a09023998 100644
 50--- a/oh-my-zsh.sh
 51+++ b/oh-my-zsh.sh
 52@@ -12,7 +12,7 @@ for config_file ($ZSH/custom/*.zsh) source $config_file
 53 
 54 # Load all of the plugins that were defined in ~/.zshrc
 55 plugin=${plugin:=()}
 56-for plugin ($plugins) source $ZSH/plugins/$plugin.plugin.zsh
 57+for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
 58 
 59 # Check for updates on initial load...
 60 if [ "$DISABLE_AUTO_UPDATE" = "true" ]
 61@@ -21,5 +21,3 @@ then
 62 else
 63   /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
 64 fi
 65-
 66-unset config_file
 67diff --git a/plugins/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
 68rename from plugins/brew.plugin.zsh
 69rename to plugins/brew/brew.plugin.zsh
 70diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh
 71new file mode 100644
 72index 0000000000000000000000000000000000000000..6a2b289a2881abeeee97a47fb40dfffeb07c6077
 73--- /dev/null
 74+++ b/plugins/dirpersist/dirpersist.plugin.zsh
 75@@ -0,0 +1,39 @@
 76+#!/bin/zsh
 77+# 
 78+# Make the dirstack more persistant
 79+# 
 80+# Add dirpersist to $plugins in ~/.zshrc to load
 81+# 
 82+
 83+# $zdirstore is the file used to persist the stack
 84+zdirstore=~/.zdirstore
 85+
 86+dirpersistinstall () {
 87+    if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
 88+    else
 89+        if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
 90+            echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
 91+        else
 92+            echo "If you don't want this message to appear, remove dirspersist from \$plugins"
 93+        fi
 94+    fi
 95+}
 96+
 97+dirpersiststore () {
 98+    dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore
 99+}
100+
101+dirpersistrestore () {
102+    if [ -f $zdirstore ]; then
103+        source $zdirstore
104+    fi
105+}
106+
107+DIRSTACKSIZE=10
108+setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
109+
110+dirpersistinstall
111+dirpersistrestore
112+
113+# Make popd changes permanent without having to wait for logout
114+alias popd="popd;dirpersiststore"
115diff --git a/plugins/git.plugin.zsh b/plugins/git/git.plugin.zsh
116rename from plugins/git.plugin.zsh
117rename to plugins/git/git.plugin.zsh
118diff --git a/plugins/lighthouse.plugin.zsh b/plugins/lighthouse/lighthouse.plugin.zsh
119rename from plugins/lighthouse.plugin.zsh
120rename to plugins/lighthouse/lighthouse.plugin.zsh
121diff --git a/plugins/macports/macports.plugin.zsh b/plugins/macports/macports.plugin.zsh
122new file mode 100644
123index 0000000000000000000000000000000000000000..9564829b036373ce405dd17c61936a9b5ab4184d
124--- /dev/null
125+++ b/plugins/macports/macports.plugin.zsh
126@@ -0,0 +1,7 @@
127+#Aliases
128+alias pc="sudo port clean --all installed"
129+alias pi="sudo port install $1"
130+alias psu="sudo port selfupdate"
131+alias puni="sudo port uninstall inactive"
132+alias puo="sudo port upgrade outdated"
133+alias pup="psu && puo"
134diff --git a/plugins/mysql-macports.plugin.zsh b/plugins/mysql/mysql-macports.plugin.zsh
135rename from plugins/mysql-macports.plugin.zsh
136rename to plugins/mysql/mysql-macports.plugin.zsh
137diff --git a/plugins/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
138rename from plugins/osx.plugin.zsh
139rename to plugins/osx/osx.plugin.zsh
140diff --git a/plugins/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
141rename from plugins/rails.plugin.zsh
142rename to plugins/rails/rails.plugin.zsh
143diff --git a/plugins/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh
144rename from plugins/ruby.plugin.zsh
145rename to plugins/ruby/ruby.plugin.zsh
146diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
147new file mode 100644
148index 0000000000000000000000000000000000000000..ce0d645c1c00ae3494aeeb5ff1f0ebd334b00955
149--- /dev/null
150+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
151@@ -0,0 +1,23 @@
152+# Based on code from Joseph M. Reagle
153+# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
154+
155+local SSH_ENV=$HOME/.ssh/environment
156+
157+function start_agent {
158+  /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
159+  chmod 600 ${SSH_ENV}
160+  . ${SSH_ENV} > /dev/null
161+  /usr/bin/ssh-add;
162+}
163+
164+# Source SSH settings, if applicable
165+
166+if [ -f "${SSH_ENV}" ]; then
167+  . ${SSH_ENV} > /dev/null
168+  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
169+    start_agent;
170+  }
171+else
172+  start_agent;
173+fi
174+
175diff --git a/plugins/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh
176rename from plugins/textmate.plugin.zsh
177rename to plugins/textmate/textmate.plugin.zsh
178diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
179new file mode 100644
180index 0000000000000000000000000000000000000000..c47ab72114562251e4ca75f1395dcaea1abe2002
181--- /dev/null
182+++ b/plugins/vi-mode/vi-mode.plugin.zsh
183@@ -0,0 +1,22 @@
184+function zle-line-init zle-keymap-select {
185+  zle reset-prompt
186+}
187+
188+zle -N zle-line-init
189+zle -N zle-keymap-select
190+
191+bindkey -v
192+
193+# if mode indicator wasn't setup by theme, define default
194+if [[ "$MODE_INDICATOR" == "" ]]; then
195+  MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
196+fi
197+
198+function vi_mode_prompt_info() {
199+  echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
200+}
201+
202+# define right prompt, if it wasn't defined by a theme
203+if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
204+  RPS1='$(vi_mode_prompt_info)'
205+fi
206diff --git a/themes/kennethreitz.zsh-theme b/themes/kennethreitz.zsh-theme
207new file mode 100644
208index 0000000000000000000000000000000000000000..109be0c2244c774eabed3eba38c3ad2816e9f1d3
209--- /dev/null
210+++ b/themes/kennethreitz.zsh-theme
211@@ -0,0 +1,13 @@
212+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
213+
214+PROMPT='%{$fg[green]%}%c \
215+$(git_prompt_info)\
216+%{$fg[red]%}%(!.#.»)%{$reset_color%} '
217+PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
218+RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
219+
220+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}("
221+ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} "
222+ZSH_THEME_GIT_PROMPT_CLEAN=""
223+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}"
224+
225diff --git a/themes/theunraveler.zsh-theme b/themes/theunraveler.zsh-theme
226new file mode 100644
227index 0000000000000000000000000000000000000000..4eec8e827d98b1f5df8a780bfe03e3f87de25d18
228--- /dev/null
229+++ b/themes/theunraveler.zsh-theme
230@@ -0,0 +1,6 @@
231+# Comment 
232+
233+ZSH_THEME_GIT_PROMPT_PREFIX=' (git:'
234+ZSH_THEME_GIT_PROMPT_SUFFIX=')'
235+
236+PROMPT='%{$fg[magenta]%}[%c]$(git_prompt_info) $ %{$reset_color%}'