Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite of plugin override #359

Merged
merged 1 commit into from May 29, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,5 +2,6 @@ locals.zsh
log/.zsh_history log/.zsh_history
projects.zsh projects.zsh
custom/* custom/*
!custom/example
!custom/example.zsh !custom/example.zsh
cache cache
6 changes: 4 additions & 2 deletions README.textile
Expand Up @@ -48,7 +48,9 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
h3. Customization 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 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 h3. Uninstalling


Expand All @@ -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 * "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors


Thank you so much! Thank you so much!
2 changes: 2 additions & 0 deletions custom/example/example.plugin.zsh
@@ -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 changes: 3 additions & 1 deletion oh-my-zsh.sh
Expand Up @@ -17,7 +17,9 @@ compinit -i


# Load all of the plugins that were defined in ~/.zshrc # Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do 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 source $ZSH/plugins/$plugin/$plugin.plugin.zsh
fi fi
done done
Expand Down