8b69c7f6a0c80c1c53505e17d356387b83e18efc

Author
Peter Tillemans <pti@snamellit.com>
Committer
Peter Tillemans <pti@snamellit.com>
Date

Message

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

Diff

This diff is truncated to protect this page.

  1diff --git a/.gitignore b/.gitignore
  2index 2e8db7341894fdf0940c0c37995e93e1b3b0d9fa..51a5ee6c396f012ae162d0d63006d4d8e765b92f 100644
  3--- a/.gitignore
  4+++ b/.gitignore
  5@@ -4,5 +4,6 @@ projects.zsh
  6 custom/*
  7 !custom/example
  8 !custom/example.zsh
  9-cache
 10 *.swp
 11+!custom/example.zshcache
 12+cache/
 13diff --git a/README.textile b/README.textile
 14index bf6776665fa72c8025dc64ff72d7a38d36e0380a..a38e2d7cf83748f562590b4eb9383a827bc8d16f 100644
 15--- a/README.textile
 16+++ b/README.textile
 17@@ -1,5 +1,6 @@
 18 A handful of functions, auto-complete helpers, and stuff that makes you shout...
 19 
 20+
 21 bq. "OH MY ZSHELL!"
 22 
 23 h2. Setup
 24@@ -68,9 +69,13 @@ h2. Help out!
 25 
 26 I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
 27 
 28-h3. Send us your theme!
 29+h3. (Don't) Send us your theme! (for now)
 30+
 31+-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.-
 32+
 33+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. 
 34+
 35 
 36-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
 37 
 38 h2. Contributors
 39 
 40diff --git a/lib/completion.zsh b/lib/completion.zsh
 41index b964595edfbaec82a87a7b44c1c3b2088dbd3a69..f31e101d5d2c9ad441af6468b8327b0c675997c8 100644
 42--- a/lib/completion.zsh
 43+++ b/lib/completion.zsh
 44@@ -46,7 +46,7 @@ zstyle ':completion:*:hosts' hosts $hosts
 45 
 46 # Use caching so that commands like apt and dpkg complete are useable
 47 zstyle ':completion::complete:*' use-cache 1
 48-zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/
 49+zstyle ':completion::complete:*' cache-path $ZSH/cache/
 50 
 51 # Don't complete uninteresting users
 52 zstyle ':completion:*:*:*:users' ignored-patterns \
 53diff --git a/lib/directories.zsh b/lib/directories.zsh
 54index bb114f61531a2086ebf16d9266d519dba592c0be..a787db9ebda2664163bebd1a42ce4727801eef61 100644
 55--- a/lib/directories.zsh
 56+++ b/lib/directories.zsh
 57@@ -36,9 +36,9 @@ cd () {
 58 
 59 alias md='mkdir -p'
 60 alias rd=rmdir
 61-alias d='dirs -v'
 62+alias d='dirs -v | head -10'
 63 
 64 # mkdir & cd to it
 65 function mcd() { 
 66   mkdir -p "$1" && cd "$1"; 
 67-}
 68+}
 69diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
 70index 5c1b90bfa94d4a3e9497383e0c6eac9f7a4ed07f..5f499f3e8a56fcfcf24df504994dc3859670f53a 100644
 71--- a/lib/key-bindings.zsh
 72+++ b/lib/key-bindings.zsh
 73@@ -3,7 +3,6 @@
 74 bindkey -e
 75 bindkey '\ew' kill-region
 76 bindkey -s '\el' "ls\n"
 77-bindkey -s '\e.' "..\n"
 78 bindkey '^r' history-incremental-search-backward
 79 bindkey "^[[5~" up-line-or-history
 80 bindkey "^[[6~" down-line-or-history
 81diff --git a/lib/misc.zsh b/lib/misc.zsh
 82index 88732e664e1fc4ec3c5cb8e8e04ccc2ba9761dba..0f7e7e9254959f01d6186c16f147764e9645e8b2 100644
 83--- a/lib/misc.zsh
 84+++ b/lib/misc.zsh
 85@@ -9,5 +9,5 @@ bindkey "^[m" copy-prev-shell-word
 86 setopt long_list_jobs
 87 
 88 ## pager
 89-export PAGER=less
 90+export PAGER="less -R"
 91 export LC_CTYPE=$LANG
 92diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 93index 221989502360e4182d14489765578b5ee9ff5491..e26fef6d30d8a3f46e1fa4862c20626815743891 100644
 94--- a/lib/termsupport.zsh
 95+++ b/lib/termsupport.zsh
 96@@ -3,7 +3,9 @@
 97 #Fully support screen, iterm, and probably most modern xterm and rxvt
 98 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
 99 function title {
100-  [ "$DISABLE_AUTO_TITLE" != "true" ] || return
101+  if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
102+    return
103+  fi
104   if [[ "$TERM" == screen* ]]; then
105     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
106   elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
107diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
108index 2b80b76e679a37f29ef2559b5f6f1bf44a0aff5c..1ca48089e17848c3fadaa76b23566b801bd19e24 100644
109--- a/plugins/bundler/bundler.plugin.zsh
110+++ b/plugins/bundler/bundler.plugin.zsh
111@@ -6,7 +6,7 @@ alias bu="bundle update"
112 
113 # The following is based on https://github.com/gma/bundler-exec
114 
115-bundled_commands=(annotate cap capify cucumber ey foreman guard middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
116+bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
117 
118 ## Functions
119 
120diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh
121new file mode 100644
122index 0000000000000000000000000000000000000000..46a0ab268796c897de82a82c6108641446fb596c
123--- /dev/null
124+++ b/plugins/dircycle/dircycle.plugin.zsh
125@@ -0,0 +1,10 @@
126+##
127+# dircycle plugin: enables cycling through the directory
128+# stack using Ctrl+Shift+Left/Right
129+
130+eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }"
131+zle -N insert-cycledleft
132+bindkey "\e[1;6D" insert-cycledleft
133+eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q -0'; zle accept-line }"
134+zle -N insert-cycledright
135+bindkey "\e[1;6C" insert-cycledright
136diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh
137index 6a2b289a2881abeeee97a47fb40dfffeb07c6077..0f6d9f435a5c318d6bd7674c4154d8ad9eb18184 100644
138--- a/plugins/dirpersist/dirpersist.plugin.zsh
139+++ b/plugins/dirpersist/dirpersist.plugin.zsh
140@@ -12,7 +12,7 @@ dirpersistinstall () {
141     if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
142     else
143         if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
144-            echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
145+            echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
146         else
147             echo "If you don't want this message to appear, remove dirspersist from \$plugins"
148         fi
149diff --git a/plugins/encode64/encode64.plugin.zsh b/plugins/encode64/encode64.plugin.zsh
150new file mode 100644
151index 0000000000000000000000000000000000000000..cfb7c6a18305c7b67507743b3b0977f4b4b3a047
152--- /dev/null
153+++ b/plugins/encode64/encode64.plugin.zsh
154@@ -0,0 +1,2 @@
155+encode64(){ echo -n $1 | base64 }
156+decode64(){ echo -n $1 | base64 -D }
157diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
158index 270bcbe389b79224d4725e45be39abb4c3823829..71b343884a5428660c92ce86ca63823d4337f8c7 100644
159--- a/plugins/git-flow/git-flow.plugin.zsh
160+++ b/plugins/git-flow/git-flow.plugin.zsh
161@@ -110,6 +110,8 @@ __git-flow-release ()
162 						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
163 						-m'[Use the given tag message]'\
164 						-p'[Push to $ORIGIN after performing finish]'\
165+						-k'[Keep branch after performing finish]'\
166+						-n"[Don't tag this release]"\
167 						':version:__git_flow_version_list'
168 				;;
169 
170@@ -162,6 +164,8 @@ __git-flow-hotfix ()
171 						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
172 						-m'[Use the given tag message]'\
173 						-p'[Push to $ORIGIN after performing finish]'\
174+						-k'[Keep branch after performing finish]'\
175+						-n"[Don't tag this release]"\
176 						':hotfix:__git_flow_hotfix_list'
177 				;;
178 
179diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
180index e1d68250885a7e29e286e30b469fc17e9ae5cc3b..d3d3f702a362c6ebe24109369da2e6d1a8652464 100644
181--- a/plugins/git/git.plugin.zsh
182+++ b/plugins/git/git.plugin.zsh
183@@ -54,10 +54,16 @@ function current_branch() {
184   echo ${ref#refs/heads/}
185 }
186 
187+function current_repository() {
188+
189+  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
190+  echo $(git remote -v | cut -d':' -f 2)
191+}
192+
193 # these aliases take advantage of the previous function
194 alias ggpull='git pull origin $(current_branch)'
195 compdef ggpull=git
196 alias ggpush='git push origin $(current_branch)'
197 compdef ggpush=git
198 alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
199-compdef ggpnp=git
200+compdef ggpnp=git
201diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
202new file mode 100644
203index 0000000000000000000000000000000000000000..e8af2f49d5d2f87daeae99b23d59fecdc7b44d26
204--- /dev/null
205+++ b/plugins/mvn/mvn.plugin.zsh
206@@ -0,0 +1,6 @@
207+function listMavenCompletions { 
208+	 reply=(
209diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
210index d4c7df6548740c9c34c3729b34c03a4e7b9b5ecf..237d0594bf8964707cfa2935b8f09f26fb095646 100644
211--- a/plugins/rails3/rails3.plugin.zsh
212+++ b/plugins/rails3/rails3.plugin.zsh
213@@ -13,6 +13,7 @@ alias rd='_rails_command destroy'
214 alias rdb='_rails_command dbconsole'
215 alias rdbm='rake db:migrate db:test:clone'
216 alias rg='_rails_command generate'
217+alias rgm='_rails_command generate migration'
218 alias rp='_rails_command plugin'
219 alias ru='_rails_command runner'
220 alias rs='_rails_command server'
221diff --git a/plugins/screen/screen.plugin.zsh b/plugins/screen/screen.plugin.zsh
222new file mode 100644
223index 0000000000000000000000000000000000000000..98178e807cce8d2f9363c0dda5d53bbc8466456d
224--- /dev/null
225+++ b/plugins/screen/screen.plugin.zsh
226@@ -0,0 +1,54 @@
227+# if using GNU screen, let the zsh tell screen what the title and hardstatus
228+# of the tab window should be.
229+if [[ $TERM == "screen" ]]; then
230+  if [[ $_GET_PATH == '' ]]; then
231+    _GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^\/home\//~/;s/^~$USER/~/"'
232+  fi
233+  if [[ $_GET_HOST == '' ]]; then
234+    _GET_HOST='echo $HOST | sed "s/\..*//"'
235+  fi
236+
237+  # use the current user as the prefix of the current tab title 
238+  TAB_TITLE_PREFIX='"`'$_GET_HOST'`:`'$_GET_PATH' | sed "s:..*/::"`$PROMPT_CHAR"'
239+  # when at the shell prompt, show a truncated version of the current path (with
240+  # standard ~ replacement) as the rest of the title.
241+  TAB_TITLE_PROMPT='$SHELL:t'
242+  # when running a command, show the title of the command as the rest of the
243+  # title (truncate to drop the path to the command)
244+  TAB_TITLE_EXEC='$cmd[1]:t'
245+
246+  # use the current path (with standard ~ replacement) in square brackets as the
247+  # prefix of the tab window hardstatus.
248+  TAB_HARDSTATUS_PREFIX='"[`'$_GET_PATH'`] "'
249+  # when at the shell prompt, use the shell name (truncated to remove the path to
250+  # the shell) as the rest of the title
251+  TAB_HARDSTATUS_PROMPT='$SHELL:t'
252+  # when running a command, show the command name and arguments as the rest of
253+  # the title
254+  TAB_HARDSTATUS_EXEC='$cmd'
255+
256+  # tell GNU screen what the tab window title ($1) and the hardstatus($2) should be
257+  function screen_set()
258+  {
259+    # set the tab window title (%t) for screen
260+    print -nR $'\033k'$1$'\033'\\\
261+
262+    # set hardstatus of tab window (%h) for screen
263+    print -nR $'\033]0;'$2$'\a'
264+  }
265+  # called by zsh before executing a command
266+  function preexec()
267+  {
268+    local -a cmd; cmd=(${(z)1}) # the command string
269+    eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_EXEC"
270+    eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_EXEC"
271+    screen_set $tab_title $tab_hardstatus
272+  }
273+  # called by zsh before showing the prompt
274+  function precmd()
275+  {
276+    eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_PROMPT"
277+    eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_PROMPT"
278+    screen_set $tab_title $tab_hardstatus
279+  }
280+fi
281diff --git a/plugins/suse/suse.plugin.zsh b/plugins/suse/suse.plugin.zsh
282new file mode 100644
283index 0000000000000000000000000000000000000000..d46286948dc873f4284d3fd4b83f41fbb7205846
284--- /dev/null
285+++ b/plugins/suse/suse.plugin.zsh
286@@ -0,0 +1,7 @@
287+alias zi='sudo zypper install'
288+alias zrf='sudo zypper refresh'
289+alias zs='zypper search'
290+alias zup='sudo zypper dist-upgrade'
291+alias zrm='sudo zypper remove'
292+alias zp='sudo zypper patch'
293+alias zps='sudo zypper ps'
294diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
295new file mode 100644
296index 0000000000000000000000000000000000000000..afdad1beaa401818fd4ac4162bc4e7a23afb83ff
297--- /dev/null
298+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
299@@ -0,0 +1,47 @@
300+WRAPPER_FOUND=0
301+for wrapsource in "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/virtualenvwrapper" ; do
302+  if [[ -e $wrapsource ]] ; then
303+    WRAPPER_FOUND=1
304+    source $wrapsource
305+
306+    if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
307+      # Automatically activate Git projects' virtual environments based on the
308+      # directory name of the project. Virtual environment name can be overridden
309+      # by placing a .venv file in the project root with a virtualenv name in it
310+      function workon_cwd {
311+          # Check that this is a Git repo
312+          GIT_DIR=`git rev-parse --git-dir 2> /dev/null`
313+          if (( $? == 0 )); then
314+              # Find the repo root and check for virtualenv name override
315+              GIT_DIR=`readlink -f $GIT_DIR`
316+              PROJECT_ROOT=`dirname "$GIT_DIR"`
317+              ENV_NAME=`basename "$PROJECT_ROOT"`
318+              if [[ -f "$PROJECT_ROOT/.venv" ]]; then
319+                  ENV_NAME=`cat "$PROJECT_ROOT/.venv"`
320+              fi
321+              # Activate the environment only if it is not already active
322+              if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then
323+                  if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then
324+                      workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME"
325+                  fi
326+              fi
327+          elif [ $CD_VIRTUAL_ENV ]; then
328+              # We've just left the repo, deactivate the environment
329+              # Note: this only happens if the virtualenv was activated automatically
330+              deactivate && unset CD_VIRTUAL_ENV
331+          fi
332+      }
333+
334+      # New cd function that does the virtualenv magic
335+      function cd {
336+          builtin cd "$@" && workon_cwd
337+      }
338+    fi
339+
340+    break
341+  fi
342+done
343+
344+if [ $WRAPPER_FOUND -eq 0 ] ; then
345+  print "zsh virtualenvwrapper plugin: Couldn't activate virtualenvwrapper. Please run \`pip install virtualenvwrapper\`."
346+fi
347diff --git a/plugins/yum/yum.plugin.zsh b/plugins/yum/yum.plugin.zsh
348index d6ba7ed62c91fb9aac9c71e4a0fcbb35aa10cf37..c9966f1b113fb0283eeca5d6cb4dee9a21bf7f51 100644
349--- a/plugins/yum/yum.plugin.zsh
350+++ b/plugins/yum/yum.plugin.zsh
351@@ -3,10 +3,14 @@
352 alias ys="yum search"                       # search package
353 alias yp="yum info"                         # show package info
354 alias yl="yum list"                         # list packages
355+alias ygl="yum grouplist"                   # list package groups
356 alias yli="yum list installed"              # print all installed packages
357+alias ymc="yum makecache                    # rebuilds the yum package list
358 
359 alias yu="sudo yum update"                  # upgrate packages
360 alias yi="sudo yum install"                 # install package
361+alias ygi="sudo yum groupinstall"           # install package group
362 alias yr="sudo yum remove"                  # remove package
363+alias ygr="sudo yum groupremove"            # remove pagage group
364 alias yrl="sudo yum remove --remove-leaves" # remove package and leaves
365-alias yc="sudo yum clean all"               # clean cache
366+alias yc="sudo yum clean all"               # clean cache
367diff --git a/themes/terminalparty.zsh-theme b/themes/terminalparty.zsh-theme
368index 73653aca84810765406c8666620a6c380e27f92f..216ce37eb4e682d7e0e999f779b84875a629a379 100644
369--- a/themes/terminalparty.zsh-theme
370+++ b/themes/terminalparty.zsh-theme
371@@ -2,7 +2,7 @@ PROMPT='%{$fg[green]%} %% '
372 # RPS1='%{$fg[blue]%}%~%{$reset_color%} '
373 RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}'
374 
375-ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[yellow]%}"
376+ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}("
377 ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
378 ZSH_THEME_GIT_PROMPT_CLEAN=""
379 ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ⚡%{$fg[yellow]%}"
380diff --git a/tools/install.sh b/tools/install.sh
381index aedb706dae1c96a71b8ec31fb2f038cc3e7a9fa3..8ca427d2caf3620d141b043ab333a005aeaf47ea 100755
382--- a/tools/install.sh
383+++ b/tools/install.sh
384@@ -5,7 +5,13 @@ then
385 fi
386 
387 echo "\033[0;34mCloning Oh My Zsh...\033[0m"
388-/usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
389+which git > /dev/null
390+if [[ $? -eq 0 ]]; then
391+  /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
392+else
393+  echo "git not installed"
394+  exit
395+fi
396 
397 echo "\033[0;34mLooking for an existing zsh config...\033[0m"
398 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]