Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adding ability to override plugins from the custom directory.

  • Loading branch information...
commit f8aae64e478066be7d05f5eb6970c356cafcfd36 1 parent ab2a7b5
Jake Bell authored May 26, 2011
1  .gitignore
@@ -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
6  README.textile
Source Rendered
@@ -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 70
 
69 71
 * "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
70 72
 
71  
-Thank you so much!
  73
+Thank you so much!
2  custom/example/example.plugin.zsh
... ...
@@ -0,0 +1,2 @@
  1
+# Add your own custom plugins in the custom/plugins directory. Plugins placed
  2
+# here will override ones with the same name in the main plugins directory.
4  oh-my-zsh.sh
@@ -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

0 notes on commit f8aae64

Please sign in to comment.
Something went wrong with that request. Please try again.