Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Rewrite of plugin override #359

Merged
merged 1 commit into from

2 participants

Jake Bell Robby Russell
Jake Bell

Redid the patch for plugin overriding. Initial discussion here: #89

Robby Russell

Thanks for taking the time to work on a new way to handle plugin overrides. :-)

Robby Russell robbyrussell merged commit 142c03d into from
Jake Bell

The script will not load scripts within subdirectories of custom. I think this feature provides for more consistency (i.e. plugin overrides use the same directory structure as the plugins themselves).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
1  .gitignore
View
@@ -2,5 +2,6 @@ locals.zsh
log/.zsh_history
projects.zsh
custom/*
+!custom/example
!custom/example.zsh
cache
6 README.textile
View
@@ -48,7 +48,9 @@ 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 @plugin/@ directory and then enable this plugin.
+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 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/@.
+
h3. Uninstalling
@@ -68,4 +70,4 @@ This project wouldn't exist without all of our awesome users and contributors.
* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
-Thank you so much!
+Thank you so much!
2  custom/example/example.plugin.zsh
View
@@ -0,0 +1,2 @@
+# Add your own custom plugins in the custom/plugins directory. Plugins placed
+# here will override ones with the same name in the main plugins directory.
4 oh-my-zsh.sh
View
@@ -17,7 +17,9 @@ compinit -i
# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
- if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
+ if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then
+ source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh
+ elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
fi
done
Something went wrong with that request. Please try again.