3cf9ab722e7c0829727f548c7d05a0d96055f707

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

Message

Initial implementation of a new plugin system, so that people can managed which aliases/functions they want.

Diff

  1diff --git a/lib/aliases.zsh b/lib/aliases.zsh
  2index d891cc0a8b28fd444341ee9fd7d94cdd309973a0..89c904a7e5f9853a9caf5a55c7d90f90f1dc9418 100644
  3--- a/lib/aliases.zsh
  4+++ b/lib/aliases.zsh
  5@@ -1,19 +1,7 @@
  6-#!/bin/zsh
  7-
  8 # Push and pop directories on directory stack
  9 alias pu='pushd'
 10 alias po='popd'
 11 
 12-alias ss='thin --stats "/thin/stats" start'
 13-alias sg='ruby script/generate'
 14-alias sd='ruby script/destroy'
 15-alias sp='ruby script/plugin'
 16-alias ssp='ruby script/spec'
 17-alias rdbm='rake db:migrate'
 18-alias sc='ruby script/console'
 19-alias sd='ruby script/server --debugger'
 20-alias devlog='tail -f log/development.log'
 21-
 22 # Basic directory operations
 23 alias .='pwd'
 24 alias ...='cd ../..'
 25@@ -33,20 +21,4 @@ alias l='ls -la'
 26 alias ll='ls -alr'
 27 alias sl=ls # often screw this up
 28 
 29-alias sgem='sudo gem'
 30-
 31-# Find ruby file
 32-alias rfind='find . -name *.rb | xargs grep -n'
 33 alias afind='ack-grep -il'
 34-
 35-# Git and svn mix
 36-alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
 37-
 38-# TextMate
 39-alias et='mate . &'
 40-alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
 41-alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
 42-alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
 43-
 44-# Editor Ruby file in TextMate
 45-alias mr='mate CHANGELOG app config db lib public script spec test'
 46diff --git a/lib/functions.zsh b/lib/functions.zsh
 47index 74b93f00e86299495b127672826aa49038056c63..35c3f3ce711b1c9b513303fd0bdd4c6ac9c9db8e 100644
 48--- a/lib/functions.zsh
 49+++ b/lib/functions.zsh
 50@@ -54,24 +54,3 @@ function take() {
 51   cd $1
 52 }
 53 
 54-function tm() {
 55-  cd $1
 56-  mate $1
 57-}
 58-
 59-# To use: add a .lighthouse file into your directory with the URL to the
 60-# individual project. For example:
 61-# https://rails.lighthouseapp.com/projects/8994
 62-# Example usage: http://screencast.com/t/ZDgwNDUwNT
 63-open_lighthouse_ticket () {
 64-  if [ ! -f .lighthouse-url ]; then
 65-    echo "There is no .lighthouse file in the current directory..."
 66-    return 0;
 67-  else
 68-    lighthouse_url=$(cat .lighthouse-url);
 69-    echo "Opening ticket #$1";
 70-    `open $lighthouse_url/tickets/$1`;
 71-  fi
 72-}
 73-
 74-alias lho='open_lighthouse_ticket'
 75diff --git a/lib/git.zsh b/lib/git.zsh
 76index 1d1d24deb6dbb9dfbdf42f7230ec77eb56834968..a54e5bcbbf58a8bb6e4f1a7f2b67bfcb98dd4c3e 100644
 77--- a/lib/git.zsh
 78+++ b/lib/git.zsh
 79@@ -20,18 +20,3 @@ function current_branch() {
 80   ref=$(git symbolic-ref HEAD 2> /dev/null) || return
 81   echo ${ref#refs/heads/}
 82 }
 83-
 84-# Aliases
 85-alias g='git'
 86-alias gst='git status'
 87-alias gl='git pull'
 88-alias gup='git fetch && git rebase'
 89-alias gp='git push'
 90-alias gd='git diff | mate'
 91-alias gdv='git diff -w "$@" | vim -R -'
 92-alias gc='git commit -v'
 93-alias gca='git commit -v -a'
 94-alias gb='git branch'
 95-alias gba='git branch -a'
 96-alias gcount='git shortlog -sn'
 97-alias gcp='git cherry-pick'
 98diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 99index a41f3d89e0d9d1846ea1d12d15658b6de52dd007..bb45c71eb6f47fc2d082f64c827dc3ff11ac2a5b 100644
100--- a/oh-my-zsh.sh
101+++ b/oh-my-zsh.sh
102@@ -10,6 +10,10 @@ for config_file ($ZSH/lib/*.zsh) source $config_file
103 # Load all of your custom configurations from custom/
104 for config_file ($ZSH/custom/*.zsh) source $config_file
105 
106+# Load all of the plugins that were defined in ~/.zshrc
107+plugin=${plugin:=()}
108+for plugin ($plugins) source $ZSH/plugins/$plugin.plugin.zsh
109+
110 # Check for updates on initial load...
111 if [ "$DISABLE_AUTO_UPDATE" = "true" ]
112 then
113diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh
114new file mode 100644
115index 0000000000000000000000000000000000000000..26777a62a2ba29de739cdf5e00a4227a4bbd84ce
116--- /dev/null
117+++ b/plugins/git.plugin.zsh
118@@ -0,0 +1,21 @@
119+# Aliases
120+alias g='git'
121+alias gst='git status'
122+alias gl='git pull'
123+alias gup='git fetch && git rebase'
124+alias gp='git push'
125+alias gd='git diff | mate'
126+alias gdv='git diff -w "$@" | vim -R -'
127+alias gc='git commit -v'
128+alias gca='git commit -v -a'
129+alias gb='git branch'
130+alias gba='git branch -a'
131+alias gcount='git shortlog -sn'
132+alias gcp='git cherry-pick'
133+
134+
135+# Git and svn mix
136+alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
137+
138+alias ggpull='git pull origin $(current_branch)'
139+alias ggpush='git push origin $(current_branch)'
140diff --git a/plugins/lighthouse.plugin.zsh b/plugins/lighthouse.plugin.zsh
141new file mode 100644
142index 0000000000000000000000000000000000000000..4eb06a997100bf1f08394626c129f571030a7517
143--- /dev/null
144+++ b/plugins/lighthouse.plugin.zsh
145@@ -0,0 +1,16 @@
146+# To use: add a .lighthouse file into your directory with the URL to the
147+# individual project. For example:
148+# https://rails.lighthouseapp.com/projects/8994
149+# Example usage: http://screencast.com/t/ZDgwNDUwNT
150+open_lighthouse_ticket () {
151+  if [ ! -f .lighthouse-url ]; then
152+    echo "There is no .lighthouse file in the current directory..."
153+    return 0;
154+  else
155+    lighthouse_url=$(cat .lighthouse-url);
156+    echo "Opening ticket #$1";
157+    `open $lighthouse_url/tickets/$1`;
158+  fi
159+}
160+
161+alias lho='open_lighthouse_ticket'
162diff --git a/plugins/rails.plugin.zsh b/plugins/rails.plugin.zsh
163new file mode 100644
164index 0000000000000000000000000000000000000000..fb21da8460602454e4c6845b28616a93d33c2b5c
165--- /dev/null
166+++ b/plugins/rails.plugin.zsh
167@@ -0,0 +1,10 @@
168+
169+alias ss='thin --stats "/thin/stats" start'
170+alias sg='ruby script/generate'
171+alias sd='ruby script/destroy'
172+alias sp='ruby script/plugin'
173+alias ssp='ruby script/spec'
174+alias rdbm='rake db:migrate'
175+alias sc='ruby script/console'
176+alias sd='ruby script/server --debugger'
177+alias devlog='tail -f log/development.log'
178diff --git a/plugins/ruby.plugin.zsh b/plugins/ruby.plugin.zsh
179new file mode 100644
180index 0000000000000000000000000000000000000000..82bf5d49d4420c398520709236a38291b4459cb9
181--- /dev/null
182+++ b/plugins/ruby.plugin.zsh
183@@ -0,0 +1,4 @@
184+alias sgem='sudo gem'
185+
186+# Find ruby file
187+alias rfind='find . -name *.rb | xargs grep -n'
188diff --git a/plugins/textmate.plugin.zsh b/plugins/textmate.plugin.zsh
189new file mode 100644
190index 0000000000000000000000000000000000000000..7b73e275152bd528fe5bf709f36db200f8b07bc8
191--- /dev/null
192+++ b/plugins/textmate.plugin.zsh
193@@ -0,0 +1,14 @@
194+
195+# TextMate
196+alias et='mate . &'
197+alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
198+alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
199+alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
200+
201+# Editor Ruby file in TextMate
202+alias mr='mate CHANGELOG app config db lib public script spec test'
203+
204+function tm() {
205+  cd $1
206+  mate $1
207+}