forked from radleylewis/zsh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugins.zsh
More file actions
29 lines (25 loc) · 856 Bytes
/
Copy pathplugins.zsh
File metadata and controls
29 lines (25 loc) · 856 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
# =========================================================
# Plugins
# =========================================================
ZPLUGINDIR="${ZDOTDIR:-$HOME/.config/zsh}/plugins"
_zplugin_load() {
local plugin_path="${ZPLUGINDIR}/${2}"
if [[ ! -d "$plugin_path" ]]; then
mkdir -p "$ZPLUGINDIR"
echo "Installing ${2}..."
git clone --depth=1 "https://github.com/${1}/${2}" "$plugin_path" \
|| { echo "ERROR: failed to install ${2}" >&2; return 1; }
fi
source "${plugin_path}/${2}.plugin.zsh"
}
zplugin-update() {
local dir
for dir in "${ZPLUGINDIR}"/*/; do
echo "Updating ${dir:t}..."
git -C "$dir" pull --ff-only
done
}
_zplugin_load zsh-users zsh-autosuggestions
_zplugin_load zsh-users zsh-history-substring-search
_zplugin_load jeffreytse zsh-vi-mode
_zplugin_load zdharma-continuum fast-syntax-highlighting