Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mogensen committed Feb 2, 2012
2 parents 1fb0118 + 3629270 commit 642128c
Show file tree
Hide file tree
Showing 28 changed files with 258 additions and 138 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

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/@.


Expand Down
2 changes: 1 addition & 1 deletion lib/git.zsh
Expand Up @@ -61,4 +61,4 @@ git_prompt_status() {
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
echo $STATUS
}
}
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
. /opt/local/etc/profile.d/autojump.sh
elif [ -f `brew --prefix`/etc/autojump ]; then
. `brew --prefix`/etc/autojump
if [ $commands[autojump] ]; then # check if autojump is installed
if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
. /usr/share/autojump/autojump.zsh
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
4 changes: 2 additions & 2 deletions plugins/bundler/bundler.plugin.zsh
Expand Up @@ -6,7 +6,7 @@ alias bu="bundle update"

# 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 thor 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

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

_within-bundled-project() {
local check_dir=$PWD
while [ "$(dirname $check_dir)" != "/" ]; do
while [ $check_dir != "/" ]; do
[ -f "$check_dir/Gemfile" ] && return
check_dir="$(dirname $check_dir)"
done
Expand Down
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
alias gp='git push'
compdef _git gp=git-push
gdv() { git-diff -w "$@" | view - }
gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff
alias gc='git commit -v'
compdef _git gc=git-commit
Expand All @@ -36,6 +36,8 @@ alias ga='git add'
compdef _git ga=git-add
alias gm='git merge'
compdef _git gm=git-merge
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'

# Git and svn mix
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)'
compdef ggpush=git
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
if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
# 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

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

# Mercurial
alias hgc='hg commit -v'
alias hgb='hg branch -v'
alias hgc='hg commit'
alias hgb='hg branch'
alias hgba='hg branches'
alias hgco='hg checkout'
alias hgd='hg diff'
alias hged='hg diffmerge'
# pull and update
alias hgl='hg pull -u -v'
alias hgp='hg push -v'
alias hgs='hg status -v'
alias hgl='hg pull -u'
alias hgp='hg push'
alias hgs='hg status'
# this is the 'git commit --amend' equivalent
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
# https://gist.github.com/965032
function kapow {
touch ~/.pow/$1/tmp/restart.txt
if [ $? -eq 0 ]; then
echo "$fg[yellow]Pow restarting $1...$reset_color"
fi
# Restart a rack app running under pow
# http://pow.cx/
#
# Adds a kapow command that will restart an app
#
# $ kapow myapp
#
# 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

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 sd='ruby script/destroy'
alias sp='ruby script/plugin'
alias sr='ruby script/runner'
alias ssp='ruby script/spec'
alias rdbm='rake db:migrate'
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 rg='_rails_command generate'
alias rp='_rails_command plugin'
alias ru='_rails_command runner'
alias rs='_rails_command server'
alias rsd='_rails_command server --debugger'
alias devlog='tail -f log/development.log'
Expand Down

0 comments on commit 642128c

Please sign in to comment.