-
Notifications
You must be signed in to change notification settings - Fork 19
/
zshrc.zsh
41 lines (38 loc) · 1.21 KB
/
zshrc.zsh
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
32
33
34
35
36
37
38
39
40
41
# where should we download your Zsh plugins?
#ZPLUGINDIR=$ZDOTDIR/plugins
##? Clone a plugin, identify its init file, source it, and add it to your fpath.
function plugin-load {
local repo plugdir initfile initfiles=()
: ${ZPLUGINDIR:=${ZDOTDIR:-~/.config/zsh}/plugins}
for repo in $@; do
plugdir=$ZPLUGINDIR/${repo:t}
initfile=$plugdir/${repo:t}.plugin.zsh
if [[ ! -d $plugdir ]]; then
echo "Cloning $repo..."
git clone -q --depth 1 --recursive --shallow-submodules \
https://github.com/$repo $plugdir
fi
if [[ ! -e $initfile ]]; then
initfiles=($plugdir/*.{plugin.zsh,zsh-theme,zsh,sh}(N))
(( $#initfiles )) || { echo >&2 "No init file found '$repo'." && continue }
ln -sf $initfiles[1] $initfile
fi
fpath+=$plugdir
(( $+functions[zsh-defer] )) && zsh-defer . $initfile || . $initfile
done
}
# make a github repo plugins list
plugins=(
sindresorhus/pure
mattmc3/zman
rupa/z
rummik/zsh-tailf
peterhurford/up.zsh
zsh-users/zsh-autosuggestions
zsh-users/zsh-history-substring-search
# load these at hypersonic load speeds with zsh-defer
romkatv/zsh-defer
olets/zsh-abbr
zdharma-continuum/fast-syntax-highlighting
)
plugin-load $plugins