From 61c39b50390a7869f22001a6cd65b7e8cd977e88 Mon Sep 17 00:00:00 2001 From: natsumesou Date: Wed, 23 May 2012 13:49:21 +0900 Subject: [PATCH 01/11] Load symlink custom files `(.)` search only real files. The deletion of it enables searching symlink *.zsh files --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c2b6049c..ddef1ad6 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -51,7 +51,7 @@ for plugin ($plugins); do done # Load all of your custom configurations from custom/ -for config_file ($ZSH_CUSTOM/*.zsh(.N)) source $config_file +for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file # Load the theme if [ "$ZSH_THEME" = "random" ] From dee54a2477d2a5be5d6cced7497f539ecfc2e05f Mon Sep 17 00:00:00 2001 From: Kristi Date: Wed, 13 Jun 2012 12:57:15 -0700 Subject: [PATCH 02/11] Use grep to detect if untracked files exist instead of storing all the output of ls-files. --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index a2583b02..f22ce271 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -81,7 +81,7 @@ add-zsh-hook chpwd steeef_chpwd function steeef_precmd { if [[ -n "$PR_GIT_UPDATE" ]] ; then # check for untracked files or updated submodules, since vcs_info doesn't - if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then + if git ls-files --other --exclude-standard 2> /dev/null | grep -q "."; then PR_GIT_UPDATE=1 FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" else From 4d6b532248fce0e71d762eb1ec3ef2ec8fcd5289 Mon Sep 17 00:00:00 2001 From: Kristi Date: Wed, 13 Jun 2012 13:14:31 -0700 Subject: [PATCH 03/11] add --directory flag --- themes/steeef.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme index f22ce271..312229e9 100644 --- a/themes/steeef.zsh-theme +++ b/themes/steeef.zsh-theme @@ -81,7 +81,7 @@ add-zsh-hook chpwd steeef_chpwd function steeef_precmd { if [[ -n "$PR_GIT_UPDATE" ]] ; then # check for untracked files or updated submodules, since vcs_info doesn't - if git ls-files --other --exclude-standard 2> /dev/null | grep -q "."; then + if git ls-files --other --exclude-standard --directory 2> /dev/null | grep -q "."; then PR_GIT_UPDATE=1 FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})" else From c65a53df811953b9f4117ff0b8014d869565bf9d Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Fri, 15 Jun 2012 10:07:22 +0300 Subject: [PATCH 04/11] Fixed unmached " in yum plugin --- plugins/yum/yum.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/yum/yum.plugin.zsh b/plugins/yum/yum.plugin.zsh index c9966f1b..69abfc4c 100644 --- a/plugins/yum/yum.plugin.zsh +++ b/plugins/yum/yum.plugin.zsh @@ -5,7 +5,7 @@ alias yp="yum info" # show package info alias yl="yum list" # list packages alias ygl="yum grouplist" # list package groups alias yli="yum list installed" # print all installed packages -alias ymc="yum makecache # rebuilds the yum package list +alias ymc="yum makecache" # rebuilds the yum package list alias yu="sudo yum update" # upgrate packages alias yi="sudo yum install" # install package From 82f785bc6751dc7c199b5d1ea068567120b92511 Mon Sep 17 00:00:00 2001 From: James Walker Date: Mon, 18 Jun 2012 10:41:19 -0400 Subject: [PATCH 05/11] remove readlink call and clean up --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index afdad1be..a93c8e86 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -10,11 +10,9 @@ for wrapsource in "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/ # by placing a .venv file in the project root with a virtualenv name in it function workon_cwd { # Check that this is a Git repo - GIT_DIR=`git rev-parse --git-dir 2> /dev/null` + PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null` if (( $? == 0 )); then - # Find the repo root and check for virtualenv name override - GIT_DIR=`readlink -f $GIT_DIR` - PROJECT_ROOT=`dirname "$GIT_DIR"` + # Check for virtualenv name override ENV_NAME=`basename "$PROJECT_ROOT"` if [[ -f "$PROJECT_ROOT/.venv" ]]; then ENV_NAME=`cat "$PROJECT_ROOT/.venv"` @@ -30,6 +28,7 @@ for wrapsource in "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/ # Note: this only happens if the virtualenv was activated automatically deactivate && unset CD_VIRTUAL_ENV fi + unset PROJECT_ROOT } # New cd function that does the virtualenv magic From e9a9deacb09196a48a39adc827d861e1896f4c59 Mon Sep 17 00:00:00 2001 From: Tima Maslyuchenko Date: Mon, 18 Jun 2012 20:15:57 +0300 Subject: [PATCH 06/11] rbenv plugin now uses 'brew --prefix rbenv' command to find rbenv folder --- plugins/rbenv/rbenv.plugin.zsh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index ae37404c..a0a64c7e 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -1,5 +1,18 @@ +function is_homebrew_installed() { + type brew &> /dev/null +} + +function is_rbenv_installed() { + brew --prefix rbenv &> /dev/null +} + FOUND_RBENV=0 -for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do +rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv") +if is_homebrew_installed && is_rbenv_installed ; then + rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") +fi + +for rbenvdir in "${rbenvdirs[@]}" ; do if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then FOUND_RBENV=1 export RBENV_ROOT=$rbenvdir From 5931f64308cbf4b0a8ef740a6b4eda5834479bd7 Mon Sep 17 00:00:00 2001 From: Tima Maslyuchenko Date: Mon, 18 Jun 2012 21:29:24 +0300 Subject: [PATCH 07/11] sanitized code according to coding style --- plugins/rbenv/rbenv.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index a0a64c7e..a62dd560 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -1,14 +1,14 @@ -function is_homebrew_installed() { +_homebrew-installed() { type brew &> /dev/null } -function is_rbenv_installed() { +_rbenv-from-homebrew-installed() { brew --prefix rbenv &> /dev/null } FOUND_RBENV=0 rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv") -if is_homebrew_installed && is_rbenv_installed ; then +if _homebrew-installed && _rbenv-from-homebrew-installed ; then rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") fi From 7e1da28d27f42e4d873cdfc28ef362d59d8c2b07 Mon Sep 17 00:00:00 2001 From: jugyo Date: Thu, 21 Jun 2012 07:41:50 +0900 Subject: [PATCH 08/11] correct the ruby version label for rbenv --- themes/nebirhos.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/nebirhos.zsh-theme b/themes/nebirhos.zsh-theme index c5864d9b..a5a226b6 100644 --- a/themes/nebirhos.zsh-theme +++ b/themes/nebirhos.zsh-theme @@ -6,7 +6,7 @@ if [ -e ~/.rvm/bin/rvm-prompt ]; then RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} " else if which rbenv &> /dev/null; then - RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} " + RUBY_PROMPT_="%{$fg_bold[blue]%}rbenv:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} " fi fi From 3aa0cb74d0a19a8053889a976404a7915585466e Mon Sep 17 00:00:00 2001 From: Volker Pacher Date: Fri, 22 Jun 2012 18:27:21 +0100 Subject: [PATCH 09/11] added plugin for jruby --- plugins/jruby/jruby.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 plugins/jruby/jruby.plugin.zsh diff --git a/plugins/jruby/jruby.plugin.zsh b/plugins/jruby/jruby.plugin.zsh new file mode 100755 index 00000000..58781fc7 --- /dev/null +++ b/plugins/jruby/jruby.plugin.zsh @@ -0,0 +1,3 @@ +# Aliases +alias jrspec='jruby --debug -S rspec --debug' +alias jprofile='jruby --profile.api -S rspec' From 5c37c85fb49a377b59115efc2aa132665982ac06 Mon Sep 17 00:00:00 2001 From: Volker Pacher Date: Fri, 22 Jun 2012 18:33:11 +0100 Subject: [PATCH 10/11] added jexec --- plugins/jruby/jruby.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/jruby/jruby.plugin.zsh b/plugins/jruby/jruby.plugin.zsh index 58781fc7..bb7975b1 100755 --- a/plugins/jruby/jruby.plugin.zsh +++ b/plugins/jruby/jruby.plugin.zsh @@ -1,3 +1,4 @@ # Aliases alias jrspec='jruby --debug -S rspec --debug' alias jprofile='jruby --profile.api -S rspec' +alias jexec='jruby -S' From a39c9ffe5b7236b6e4dc78efa80b478cc411af7f Mon Sep 17 00:00:00 2001 From: Renan Cakirerk Date: Sat, 23 Jun 2012 14:53:40 +0300 Subject: [PATCH 11/11] Fix finding git issue. http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script --- tools/install.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index 8ca427d2..b080be3a 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -5,13 +5,10 @@ then fi echo "\033[0;34mCloning Oh My Zsh...\033[0m" -which git > /dev/null -if [[ $? -eq 0 ]]; then - /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh -else +hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { echo "git not installed" exit -fi +} echo "\033[0;34mLooking for an existing zsh config...\033[0m" if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]