-
Notifications
You must be signed in to change notification settings - Fork 11
/
z-a-linkbin.plugin.zsh
39 lines (28 loc) · 1003 Bytes
/
z-a-linkbin.plugin.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
# Original work Copyright (c) 2019-2020 Sebastian Gniazdowski
# Modified work Copyright (c) 2020 Nicholas Serrano
# License MIT
# According to the Zsh Plugin Standard:
# http://zdharma.org/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
0="${${(M)0:#/*}:-$PWD/$0}"
[[ -d $ZPFX/bin ]] || command mkdir -p "$ZPFX/bin"
autoload :za-lb-atclone-handler :za-lb-atdelete-handler
# An empty stub to fill the help handler fields
:za-lb-null-handler() { :; }
#@zinit-register-annex "z-a-linkbin" \
# subcommand:link-list \
# :za-lb-list \
# :za-lb-help-handler
@zinit-register-annex "z-a-linkbin" \
hook:atclone-50 \
:za-lb-atclone-handler \
:za-lb-null-handler \
"lbin|lbin''" # also register new ices
@zinit-register-annex "z-a-linkbin" \
hook:\%atpull-50 \
:za-lb-atclone-handler \
:za-lb-null-handler
@zinit-register-annex "z-a-linkbin" \
hook:atdelete-50 \
:za-lb-atdelete-handler \
:za-lb-null-handler