Skip to content

Commit

Permalink
Merge branch 'master' into devel
Browse files Browse the repository at this point in the history
* master: (29 commits)
  Removed trailing spaces in Git files. Fixes ohmyzsh#867
  update rails runner alias to ru
  adding engine yard command (ey) to bundler binstubs
  adding rbenv support to all the rvm themes
  Add middleman to bundled commands
  Grammar update
  Updated to latest version of taskwarrior completions (using Taskwarrior 2.0b4)
  bug : stop creating those ~ directories add powit command to symlink an app if it hasn't been already
  don't check for tmp dir
  add alias to view the standard out (puts) from any pow app
  take in csexton's changes
  fix for pow plugin to default to current dir
  added a rake plugin to disable zsh file globbing when calling rake tasks with square brackets
  fix bundler plugin for root level folders
  fixing ohmyzsh#812: adding plugins w/o plugin.zsh file to fpath.
  Add Thor to bundled commands
  Removed the assignments to fpath as well, since that's all handled in the .oh-my-zsh/oh-my-zsh.sh boot script.
  Don’t report that Oh My Zsh has been updated when it hasn’t.
  Removed calls to compinit in the extract and the bundler plugins. compinit should only be called once, after all modules, libs, etc are imported.
  check if autojump is installed
  ...

Conflicts:
	lib/git.zsh
  • Loading branch information
sirech committed Feb 11, 2012
2 parents 6c97dea + 3629270 commit 0b21dcd
Show file tree
Hide file tree
Showing 33 changed files with 348 additions and 159 deletions.
2 changes: 1 addition & 1 deletion README.textile
Expand Up @@ -56,7 +56,7 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
h3. Customization h3. Customization


If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory. If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin. 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.
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/@. 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/@.




Expand Down
12 changes: 9 additions & 3 deletions oh-my-zsh.sh
Expand Up @@ -19,13 +19,19 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom" ZSH_CUSTOM="$ZSH/custom"
fi fi



is_plugin() {
local base_dir=$1
local name=$2
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|| test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done # Add all defined plugins to fpath. This must be done
# before running compinit. # before running compinit.
plugin=${plugin:=()}
for plugin ($plugins); do for plugin ($plugins); do
if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then if is_plugin $ZSH_CUSTOM $plugin; then
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then elif is_plugin $ZSH $plugin; then
fpath=($ZSH/plugins/$plugin $fpath) fpath=($ZSH/plugins/$plugin $fpath)
fi fi
done done
Expand Down
12 changes: 8 additions & 4 deletions plugins/autojump/autojump.plugin.zsh
@@ -1,5 +1,9 @@
if [ -f /opt/local/etc/profile.d/autojump.sh ]; then if [ $commands[autojump] ]; then # check if autojump is installed
. /opt/local/etc/profile.d/autojump.sh if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
elif [ -f `brew --prefix`/etc/autojump ]; then . /usr/share/autojump/autojump.zsh
. `brew --prefix`/etc/autojump elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
. /etc/profile.d/autojump.zsh
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
. `brew --prefix`/etc/autojump
fi
fi fi
8 changes: 2 additions & 6 deletions plugins/bundler/bundler.plugin.zsh
@@ -1,7 +1,3 @@
fpath=($ZSH/plugins/bundler $fpath)
autoload -U compinit
compinit -i

alias be="bundle exec" alias be="bundle exec"
alias bi="bundle install" alias bi="bundle install"
alias bl="bundle list" alias bl="bundle list"
Expand All @@ -10,7 +6,7 @@ alias bu="bundle update"


# The following is based on https://github.com/gma/bundler-exec # The following is based on https://github.com/gma/bundler-exec


bundled_commands=(annotate cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)


## Functions ## Functions


Expand All @@ -20,7 +16,7 @@ _bundler-installed() {


_within-bundled-project() { _within-bundled-project() {
local check_dir=$PWD local check_dir=$PWD
while [ "$(dirname $check_dir)" != "/" ]; do while [ $check_dir != "/" ]; do
[ -f "$check_dir/Gemfile" ] && return [ -f "$check_dir/Gemfile" ] && return
check_dir="$(dirname $check_dir)" check_dir="$(dirname $check_dir)"
done done
Expand Down
1 change: 1 addition & 0 deletions plugins/django/django.plugin.zsh
Expand Up @@ -220,3 +220,4 @@ _managepy() {


compdef _managepy manage.py compdef _managepy manage.py
compdef _managepy django compdef _managepy django
compdef _managepy django-manage
5 changes: 0 additions & 5 deletions plugins/extract/extract.plugin.zsh
Expand Up @@ -78,8 +78,3 @@ function extract() {


alias x=extract alias x=extract


# add extract completion function to path
fpath=($ZSH/plugins/extract $fpath)
autoload -U compinit
compinit -i

6 changes: 4 additions & 2 deletions plugins/git/git.plugin.zsh
Expand Up @@ -9,7 +9,7 @@ alias gup='git fetch && git rebase'
compdef _git gup=git-fetch compdef _git gup=git-fetch
alias gp='git push' alias gp='git push'
compdef _git gp=git-push compdef _git gp=git-push
gdv() { git-diff -w "$@" | view - } gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff compdef _git gdv=git-diff
alias gc='git commit -v' alias gc='git commit -v'
compdef _git gc=git-commit compdef _git gc=git-commit
Expand All @@ -36,6 +36,8 @@ alias ga='git add'
compdef _git ga=git-add compdef _git ga=git-add
alias gm='git merge' alias gm='git merge'
compdef _git gm=git-merge compdef _git gm=git-merge
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'


# Git and svn mix # Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
Expand All @@ -58,4 +60,4 @@ compdef ggpull=git
alias ggpush='git push origin $(current_branch)' alias ggpush='git push origin $(current_branch)'
compdef ggpush=git compdef ggpush=git
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
compdef ggpnp=git compdef ggpnp=git
12 changes: 11 additions & 1 deletion plugins/github/github.plugin.zsh
@@ -1,7 +1,17 @@
# Setup hub function for git, if it is available; http://github.com/defunkt/hub # Setup hub function for git, if it is available; http://github.com/defunkt/hub
if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
# eval `hub alias -s zsh` # eval `hub alias -s zsh`
function git(){hub "$@"} function git(){
if ! (( $+_has_working_hub )); then
hub --version &> /dev/null
_has_working_hub=$(($? == 0))
fi
if (( $_has_working_hub )) ; then
hub "$@"
else
command git "$@"
fi
}
fi fi


# Functions ################################################################# # Functions #################################################################
Expand Down
10 changes: 5 additions & 5 deletions plugins/mercurial/mercurial.plugin.zsh
@@ -1,14 +1,14 @@


# Mercurial # Mercurial
alias hgc='hg commit -v' alias hgc='hg commit'
alias hgb='hg branch -v' alias hgb='hg branch'
alias hgba='hg branches' alias hgba='hg branches'
alias hgco='hg checkout' alias hgco='hg checkout'
alias hgd='hg diff' alias hgd='hg diff'
alias hged='hg diffmerge' alias hged='hg diffmerge'
# pull and update # pull and update
alias hgl='hg pull -u -v' alias hgl='hg pull -u'
alias hgp='hg push -v' alias hgp='hg push'
alias hgs='hg status -v' alias hgs='hg status'
# this is the 'git commit --amend' equivalent # this is the 'git commit --amend' equivalent
alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
70 changes: 63 additions & 7 deletions plugins/pow/pow.plugin.zsh
@@ -1,10 +1,66 @@
# Thanks to Christopher Sexton # Restart a rack app running under pow
# https://gist.github.com/965032 # http://pow.cx/
function kapow { #
touch ~/.pow/$1/tmp/restart.txt # Adds a kapow command that will restart an app
if [ $? -eq 0 ]; then #
echo "$fg[yellow]Pow restarting $1...$reset_color" # $ kapow myapp
fi #
# Supports command completion.
#
# If you are not already using completion you might need to enable it with
#
# autoload -U compinit compinit
#
# Changes:
#
# Defaults to the current application, and will walk up the tree to find
# a config.ru file and restart the corresponding app
#
# Will Detect if a app does not exist in pow and print a (slightly) helpful
# error message

rack_root_detect(){
setopt chaselinks
local orgdir=$(pwd)
local basedir=$(pwd)

while [[ $basedir != '/' ]]; do
test -e "$basedir/config.ru" && break
builtin cd ".." 2>/dev/null
basedir="$(pwd)"
done

builtin cd $orgdir 2>/dev/null
[[ ${basedir} == "/" ]] && return 1
echo `basename $basedir | sed -E "s/.(com|net|org)//"`
} }


kapow(){
local vhost=$1
[ ! -n "$vhost" ] && vhost=$(rack_root_detect)
if [ ! -h ~/.pow/$vhost ]
then
echo "pow: This domain isn’t set up yet. Symlink your application to ${vhost} first."
return 1
fi

[ ! -d ~/.pow/${vhost}/tmp ] && mkdir -p ~/.pow/$vhost/tmp
touch ~/.pow/$vhost/tmp/restart.txt;
[ $? -eq 0 ] && echo "pow: restarting $vhost.dev"
}
compctl -W ~/.pow -/ kapow compctl -W ~/.pow -/ kapow

powit(){
local basedir=$(pwd)
local vhost=$1
[ ! -n "$vhost" ] && vhost=$(rack_root_detect)
if [ ! -h ~/.pow/$vhost ]
then
echo "pow: Symlinking your app with pow. ${vhost}"
[ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost
return 1
fi
}

# View the standard out (puts) from any pow app
alias kaput="tail -f ~/Library/Logs/Pow/apps/*"
1 change: 1 addition & 0 deletions plugins/rails/rails.plugin.zsh
Expand Up @@ -2,6 +2,7 @@ alias ss='thin --stats "/thin/stats" start'
alias sg='ruby script/generate' alias sg='ruby script/generate'
alias sd='ruby script/destroy' alias sd='ruby script/destroy'
alias sp='ruby script/plugin' alias sp='ruby script/plugin'
alias sr='ruby script/runner'
alias ssp='ruby script/spec' alias ssp='ruby script/spec'
alias rdbm='rake db:migrate' alias rdbm='rake db:migrate'
alias sc='ruby script/console' alias sc='ruby script/console'
Expand Down
1 change: 1 addition & 0 deletions plugins/rails3/rails3.plugin.zsh
Expand Up @@ -14,6 +14,7 @@ alias rdb='_rails_command dbconsole'
alias rdbm='rake db:migrate db:test:clone' alias rdbm='rake db:migrate db:test:clone'
alias rg='_rails_command generate' alias rg='_rails_command generate'
alias rp='_rails_command plugin' alias rp='_rails_command plugin'
alias ru='_rails_command runner'
alias rs='_rails_command server' alias rs='_rails_command server'
alias rsd='_rails_command server --debugger' alias rsd='_rails_command server --debugger'
alias devlog='tail -f log/development.log' alias devlog='tail -f log/development.log'
Expand Down
6 changes: 6 additions & 0 deletions plugins/rake/rake.plugin.zsh
@@ -0,0 +1,6 @@
alias rake="noglob rake" # allows square brackts for rake task invocation
alias brake='noglob bundle exec rake' # execute the bundled rake gem
alias srake='noglob sudo rake' # noglob must come before sudo
alias sbrake='noglob sudo bundle exec rake' # altogether now ...


0 comments on commit 0b21dcd

Please sign in to comment.