-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreference
More file actions
31 lines (29 loc) · 903 Bytes
/
Copy pathreference
File metadata and controls
31 lines (29 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# assumes github and slash separated plugin names
github_plugins=(
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
zsh-users/zsh-history-substring-search
rupa/z
# theme
miekg/lean
# must be last
zdharma/fast-syntax-highlighting
)
for plugin in $github_plugins; do
# clone the plugin from github if it doesn't exist
if [[ ! -d ${ZDOTDIR:-$HOME}/.zsh_plugins/$plugin ]]; then
mkdir -p ${ZDOTDIR:-$HOME}/.zsh_plugins/${plugin%/*}
git clone --depth 1 --recursive https://github.com/$plugin.git ${ZDOTDIR:-$HOME}/.zsh_plugins/$plugin
fi
# load the plugin
for initscript in ${plugin#*/}.zsh ${plugin#*/}.plugin.zsh ${plugin#*/}.sh; do
if [[ -f ${ZDOTDIR:-$HOME}/.zsh_plugins/$plugin/$initscript ]]; then
source ${ZDOTDIR:-$HOME}/.zsh_plugins/$plugin/$initscript
break
fi
done
done
# clean up
unset github_plugins
unset plugin
unset initscript