Created
June 25, 2015 23:34
-
-
Save von/5892d439455d68701c83 to your computer and use it in GitHub Desktop.
Custom oh-my-zsh file to work around https://github.com/robbyrussell/oh-my-zsh/issues/4072
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load plugins and autoloads compinit | |
# | |
# Works around issues created by | |
# https://github.com/robbyrussell/oh-my-zsh/issues/4072 | |
is_plugin() { | |
local base_dir=$1 | |
local name=$2 | |
test -f $base_dir/plugins/$name/$name.plugin.zsh \ | |
|| test -f $base_dir/plugins/$name/_$name | |
} | |
# Add all defined plugins to fpath. This must be done | |
# before running compinit. | |
for plugin ($plugins); do | |
if is_plugin $ZSH_CUSTOM $plugin; then | |
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) | |
elif is_plugin $ZSH $plugin; then | |
fpath=($ZSH/plugins/$plugin $fpath) | |
fi | |
done | |
# Load and run compinit | |
autoload -U compinit | |
compinit -i -d "${ZSH_COMPDUMP}" | |
# Load all of the plugins that were defined in ~/.zshrc | |
for plugin ($plugins); do | |
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 | |
# Reset plugins so that subsequent custom files can add to it and | |
# have those plugins loaded by oh-my-zsh | |
plugins=() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment