178bce287ea26e5052091e66415521703848d5da

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

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

Diff

  1diff --git a/lib/directories.zsh b/lib/directories.zsh
  2index e445eb84cf69b96d968eff970751b00d556392b3..6c743e40ec943bbe3f188e187752e584c3bfa2db 100644
  3--- a/lib/directories.zsh
  4+++ b/lib/directories.zsh
  5@@ -26,9 +26,9 @@ cd () {
  6   elif [[ "x$*" == "x...." ]]; then
  7     cd ../../..
  8   elif [[ "x$*" == "x....." ]]; then
  9-    cd ../../..
 10-  elif [[ "x$*" == "x......" ]]; then
 11     cd ../../../..
 12+  elif [[ "x$*" == "x......" ]]; then
 13+    cd ../../../../..
 14   else
 15     builtin cd "$@"
 16   fi
 17diff --git a/lib/git.zsh b/lib/git.zsh
 18index 52477baf68539374a33eef7e1eb63765fb1811ed..95dd3dd43313e655a7bc86ae6e3f9384f01faa84 100644
 19--- a/lib/git.zsh
 20+++ b/lib/git.zsh
 21@@ -58,7 +58,7 @@ function git_prompt_long_sha() {
 22 
 23 # Get the status of the working tree
 24 git_prompt_status() {
 25-  INDEX=$(git status --porcelain 2> /dev/null)
 26+  INDEX=$(git status --porcelain -b 2> /dev/null)
 27   STATUS=""
 28   if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
 29     STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
 30@@ -80,12 +80,23 @@ git_prompt_status() {
 31   fi
 32   if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
 33     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 34+  elif $(echo "$INDEX" | grep '^D  ' &> /dev/null); then
 35+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 36   elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
 37     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 38   fi
 39   if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
 40     STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
 41   fi
 42+  if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
 43+    STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
 44+  fi
 45+  if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
 46+    STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
 47+  fi
 48+  if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
 49+    STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
 50+  fi
 51   echo $STATUS
 52 }
 53 
 54diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 55index c056989eb5a49df87a69f343362f11adb545acfb..7470110b67dcc40df5e876d2bb7e8268105eb850 100644
 56--- a/lib/termsupport.zsh
 57+++ b/lib/termsupport.zsh
 58@@ -8,6 +8,8 @@ function title {
 59   fi
 60   if [[ "$TERM" == screen* ]]; then
 61     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
 62+  elif [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
 63+    print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
 64   elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
 65     print -Pn "\e]2;$2:q\a" #set window name
 66     print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
 67diff --git a/plugins/git-remote-branch/git-remote-branch.plugin.zsh b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
 68new file mode 100644
 69index 0000000000000000000000000000000000000000..ff98cbf87a296045abbff56082dfeae839f79dbf
 70--- /dev/null
 71+++ b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
 72@@ -0,0 +1,18 @@
 73+_git_remote_branch() {
 74+  ref=$(git symbolic-ref HEAD 2> /dev/null)
 75+  if [[ -n $ref ]]; then
 76+    if (( CURRENT == 2 )); then
 77+      # first arg: operation
 78+      compadd create publish rename delete track
 79+    elif (( CURRENT == 3 )); then
 80+      # second arg: remote branch name
 81+      compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"`
 82+    elif (( CURRENT == 4 )); then
 83+      # third arg: remote name
 84+      compadd `git remote`
 85+    fi
 86+  else;
 87+    _files
 88+  fi
 89+}
 90+compdef _git_remote_branch grb
 91diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
 92index 35639096ef265962140e68b5fcd24931d05360e7..f39a73c9210eb7c7d7ea5b2f2fef6deb9f09ca5c 100644
 93--- a/plugins/git/git.plugin.zsh
 94+++ b/plugins/git/git.plugin.zsh
 95@@ -9,6 +9,7 @@ alias gup='git pull --rebase'
 96 compdef _git gup=git-fetch
 97 alias gp='git push'
 98 compdef _git gp=git-push
 99+alias gd='git diff'
100 gdv() { git diff -w "$@" | view - }
101 compdef _git gdv=git-diff
102 alias gc='git commit -v'
103@@ -24,6 +25,7 @@ alias gba='git branch -a'
104 compdef _git gba=git-branch
105 alias gcount='git shortlog -sn'
106 compdef gcount=git
107+alias gcl='git config --list'
108 alias gcp='git cherry-pick'
109 compdef _git gcp=git-cherry-pick
110 alias glg='git log --stat --max-count=5'
111diff --git a/plugins/history/history.plugin.zsh b/plugins/history/history.plugin.zsh
112new file mode 100644
113index 0000000000000000000000000000000000000000..0f4aa4b10720d359d48cbac77c86234bf26f56a3
114--- /dev/null
115+++ b/plugins/history/history.plugin.zsh
116@@ -0,0 +1,8 @@
117+alias h='history'
118+
119+function hs
120+{
121+    history | grep $*
122+}
123+
124+alias hsi='hs -i'
125diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
126index 682bb2667bc2cec79c6edd5870d4d42c871844f2..f278d4f8d2107a682f0ca3da92812f8a99f2ceaf 100644
127--- a/plugins/osx/osx.plugin.zsh
128+++ b/plugins/osx/osx.plugin.zsh
129@@ -2,10 +2,9 @@
130 #          FILE:  osx.plugin.zsh
131 #   DESCRIPTION:  oh-my-zsh plugin file.
132 #        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
133-#       VERSION:  1.0.1
134+#       VERSION:  1.1.0
135 # ------------------------------------------------------------------------------
136 
137-
138 function tab() {
139   local command="cd \\\"$PWD\\\""
140   (( $# > 0 )) && command="${command}; $*"
141@@ -35,9 +34,67 @@ EOF
142           launch session "Default Session"
143           set current_session to current session
144           tell current_session
145-            write text "${command}"
146+            write text "${command}; clear;"
147+          end tell
148+        end tell
149+      end tell
150+EOF
151+  }
152+}
153+
154+function vsplit_tab() {
155+  local command="cd \\\"$PWD\\\""
156+  (( $# > 0 )) && command="${command}; $*"
157+
158+  the_app=$(
159+    osascript 2>/dev/null <<EOF
160+      tell application "System Events"
161+        name of first item of (every process whose frontmost is true)
162+      end tell
163+EOF
164+  )
165+
166+  [[ "$the_app" == 'iTerm' ]] && {
167+    osascript 2>/dev/null <<EOF
168+      tell application "iTerm" to activate
169+
170+      tell application "System Events"
171+        tell process "iTerm"
172+          tell menu item "Split Vertically With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
173+            click
174+          end tell
175+        end tell
176+        keystroke "${command}; clear;"
177+        keystroke return
178+      end tell
179+EOF
180+  }
181+}
182+
183+function split_tab() {
184+  local command="cd \\\"$PWD\\\""
185+  (( $# > 0 )) && command="${command}; $*"
186+
187+  the_app=$(
188+    osascript 2>/dev/null <<EOF
189+      tell application "System Events"
190+        name of first item of (every process whose frontmost is true)
191+      end tell
192+EOF
193+  )
194+
195+  [[ "$the_app" == 'iTerm' ]] && {
196+    osascript 2>/dev/null <<EOF
197+      tell application "iTerm" to activate
198+
199+      tell application "System Events"
200+        tell process "iTerm"
201+          tell menu item "Split Horizontally With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
202+            click
203           end tell
204         end tell
205+        keystroke "${command}; clear;"
206+        keystroke return
207       end tell
208 EOF
209   }
210diff --git a/plugins/symfony/symfony.plugin.zsh b/plugins/symfony/symfony.plugin.zsh
211new file mode 100644
212index 0000000000000000000000000000000000000000..9de767548b85e282ab994ca0d3522587f1fcba49
213--- /dev/null
214+++ b/plugins/symfony/symfony.plugin.zsh
215@@ -0,0 +1,13 @@
216+# symfony basic command completion
217+
218+_symfony_get_command_list () {
219+    ./symfony | sed "1,/Available tasks/d" | awk 'BEGIN { cat=null; } /^[A-Za-z]+$/ { cat = $1; } /^  :[a-z]+/ { print cat $1; }'
220+}
221+
222+_symfony () {
223+  if [ -f symfony ]; then
224+    compadd `_symfony_get_command_list`
225+  fi
226+}
227+
228+compdef _symfony symfony
229diff --git a/themes/cloud.zsh-theme b/themes/cloud.zsh-theme
230index ad5e2834b832938faa4b0a8f12cb060e849cff64..4efbf9776f65981b898e4212a87b93e5d4926b86 100644
231--- a/themes/cloud.zsh-theme
232+++ b/themes/cloud.zsh-theme
233@@ -1,4 +1,8 @@
234-PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
235+if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
236+    ZSH_THEME_CLOUD_PREFIX='☁'
237+fi
238+
239+PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
240 
241 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
242 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"