mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
omz tool to dynamically load plugins
This commit is contained in:
parent
42d1ae029c
commit
b326820004
5 changed files with 100 additions and 41 deletions
19
tools/omz-plugin.sh
Executable file
19
tools/omz-plugin.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
# Load plugin passed as first arg
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
PLUGIN="$ZSH/plugins/$1"
|
||||
|
||||
if [ -d $PLUGIN ]; then
|
||||
fpath=($PLUGIN $fpath)
|
||||
source $PLUGIN/*.plugin.zsh
|
||||
autoload -U compinit
|
||||
compinit -i
|
||||
echo "$1 enabled!"
|
||||
else
|
||||
echo "Plugin '$1' not found!"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
echo "Please specify a plugin"
|
||||
return 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue