Browse code

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

Robby Russell authored on 03/06/2010 at 19:03:26
Showing 9 changed files
... ...
@@ -1,19 +1,7 @@
1
-#!/bin/zsh
2
-
3 1
 # Push and pop directories on directory stack
4 2
 alias pu='pushd'
5 3
 alias po='popd'
6 4
 
7
-alias ss='thin --stats "/thin/stats" start'
8
-alias sg='ruby script/generate'
9
-alias sd='ruby script/destroy'
10
-alias sp='ruby script/plugin'
11
-alias ssp='ruby script/spec'
12
-alias rdbm='rake db:migrate'
13
-alias sc='ruby script/console'
14
-alias sd='ruby script/server --debugger'
15
-alias devlog='tail -f log/development.log'
16
-
17 5
 # Basic directory operations
18 6
 alias .='pwd'
19 7
 alias ...='cd ../..'
... ...
@@ -33,20 +21,4 @@ alias l='ls -la'
33 33
 alias ll='ls -alr'
34 34
 alias sl=ls # often screw this up
35 35
 
36
-alias sgem='sudo gem'
37
-
38
-# Find ruby file
39
-alias rfind='find . -name *.rb | xargs grep -n'
40 36
 alias afind='ack-grep -il'
41
-
42
-# Git and svn mix
43
-alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
44
-
45
-# TextMate
46
-alias et='mate . &'
47
-alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
48
-alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
49
-alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
50
-
51
-# Editor Ruby file in TextMate
52
-alias mr='mate CHANGELOG app config db lib public script spec test'
... ...
@@ -54,24 +54,3 @@ function take() {
54 54
   cd $1
55 55
 }
56 56
 
57
-function tm() {
58
-  cd $1
59
-  mate $1
60
-}
61
-
62
-# To use: add a .lighthouse file into your directory with the URL to the
63
-# individual project. For example:
64
-# https://rails.lighthouseapp.com/projects/8994
65
-# Example usage: http://screencast.com/t/ZDgwNDUwNT
66
-open_lighthouse_ticket () {
67
-  if [ ! -f .lighthouse-url ]; then
68
-    echo "There is no .lighthouse file in the current directory..."
69
-    return 0;
70
-  else
71
-    lighthouse_url=$(cat .lighthouse-url);
72
-    echo "Opening ticket #$1";
73
-    `open $lighthouse_url/tickets/$1`;
74
-  fi
75
-}
76
-
77
-alias lho='open_lighthouse_ticket'
... ...
@@ -20,18 +20,3 @@ function current_branch() {
20 20
   ref=$(git symbolic-ref HEAD 2> /dev/null) || return
21 21
   echo ${ref#refs/heads/}
22 22
 }
23
-
24
-# Aliases
25
-alias g='git'
26
-alias gst='git status'
27
-alias gl='git pull'
28
-alias gup='git fetch && git rebase'
29
-alias gp='git push'
30
-alias gd='git diff | mate'
31
-alias gdv='git diff -w "$@" | vim -R -'
32
-alias gc='git commit -v'
33
-alias gca='git commit -v -a'
34
-alias gb='git branch'
35
-alias gba='git branch -a'
36
-alias gcount='git shortlog -sn'
37
-alias gcp='git cherry-pick'
... ...
@@ -10,6 +10,10 @@ for config_file ($ZSH/lib/*.zsh) source $config_file
10 10
 # Load all of your custom configurations from custom/
11 11
 for config_file ($ZSH/custom/*.zsh) source $config_file
12 12
 
13
+# Load all of the plugins that were defined in ~/.zshrc
14
+plugin=${plugin:=()}
15
+for plugin ($plugins) source $ZSH/plugins/$plugin.plugin.zsh
16
+
13 17
 # Check for updates on initial load...
14 18
 if [ "$DISABLE_AUTO_UPDATE" = "true" ]
15 19
 then
16 20
new file mode 100644
... ...
@@ -0,0 +1,21 @@
0
+# Aliases
1
+alias g='git'
2
+alias gst='git status'
3
+alias gl='git pull'
4
+alias gup='git fetch && git rebase'
5
+alias gp='git push'
6
+alias gd='git diff | mate'
7
+alias gdv='git diff -w "$@" | vim -R -'
8
+alias gc='git commit -v'
9
+alias gca='git commit -v -a'
10
+alias gb='git branch'
11
+alias gba='git branch -a'
12
+alias gcount='git shortlog -sn'
13
+alias gcp='git cherry-pick'
14
+
15
+
16
+# Git and svn mix
17
+alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
18
+
19
+alias ggpull='git pull origin $(current_branch)'
20
+alias ggpush='git push origin $(current_branch)'
0 21
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+# To use: add a .lighthouse file into your directory with the URL to the
1
+# individual project. For example:
2
+# https://rails.lighthouseapp.com/projects/8994
3
+# Example usage: http://screencast.com/t/ZDgwNDUwNT
4
+open_lighthouse_ticket () {
5
+  if [ ! -f .lighthouse-url ]; then
6
+    echo "There is no .lighthouse file in the current directory..."
7
+    return 0;
8
+  else
9
+    lighthouse_url=$(cat .lighthouse-url);
10
+    echo "Opening ticket #$1";
11
+    `open $lighthouse_url/tickets/$1`;
12
+  fi
13
+}
14
+
15
+alias lho='open_lighthouse_ticket'
0 16
\ No newline at end of file
1 17
new file mode 100644
... ...
@@ -0,0 +1,10 @@
0
+
1
+alias ss='thin --stats "/thin/stats" start'
2
+alias sg='ruby script/generate'
3
+alias sd='ruby script/destroy'
4
+alias sp='ruby script/plugin'
5
+alias ssp='ruby script/spec'
6
+alias rdbm='rake db:migrate'
7
+alias sc='ruby script/console'
8
+alias sd='ruby script/server --debugger'
9
+alias devlog='tail -f log/development.log'
0 10
\ No newline at end of file
1 11
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+alias sgem='sudo gem'
1
+
2
+# Find ruby file
3
+alias rfind='find . -name *.rb | xargs grep -n'
0 4
\ No newline at end of file
1 5
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+
1
+# TextMate
2
+alias et='mate . &'
3
+alias ett='mate app config lib db public spec test Rakefile Capfile Todo &'
4
+alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
5
+alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &'
6
+
7
+# Editor Ruby file in TextMate
8
+alias mr='mate CHANGELOG app config db lib public script spec test'
9
+
10
+function tm() {
11
+  cd $1
12
+  mate $1
13
+}