Browse code

Merge pull request #359 from theunraveler/master

Rewrite of plugin override

Robby Russell authored on 29/05/2011 at 10:56:33
Showing 4 changed files
... ...
@@ -2,5 +2,6 @@ locals.zsh
2 2
 log/.zsh_history
3 3
 projects.zsh
4 4
 custom/*
5
+!custom/example
5 6
 !custom/example.zsh
6 7
 cache
... ...
@@ -48,7 +48,9 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
48 48
 h3. Customization
49 49
 
50 50
 If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
51
-If you have many functions which go good together you can put them as a *.plugin.zsh file in the @plugin/@ directory and then enable this plugin.
51
+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.
52
+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/@.
53
+
52 54
 
53 55
 h3. Uninstalling
54 56
 
... ...
@@ -68,4 +70,4 @@ This project wouldn't exist without all of our awesome users and contributors.
68 68
 
69 69
 * "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
70 70
 
71
-Thank you so much!
72 71
\ No newline at end of file
72
+Thank you so much!
73 73
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+# Add your own custom plugins in the custom/plugins directory. Plugins placed
1
+# here will override ones with the same name in the main plugins directory.
... ...
@@ -17,7 +17,9 @@ compinit -i
17 17
 
18 18
 # Load all of the plugins that were defined in ~/.zshrc
19 19
 for plugin ($plugins); do
20
-  if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
20
+  if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then
21
+    source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh
22
+  elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
21 23
     source $ZSH/plugins/$plugin/$plugin.plugin.zsh
22 24
   fi
23 25
 done