-
Notifications
You must be signed in to change notification settings - Fork 0
/
activator.plugin.zsh
40 lines (27 loc) · 1.07 KB
/
activator.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
39
40
#!/bin/zsh
###################################################################
# #
# code-activator() : a terminal-based navigation utility #
# #
###################################################################
_CA__VERSION=1.0.3
_CA__DEPENDENCIES=(code-activator fzf jq git)
#####################################################################
export _CA=${0:a:h}
source $_CA/global.zsh || return 1
source $_CA/config.zsh || return 1
for Z in $(ls $_CA/zsh/*); do source $Z || return 1; done
#####################################################################
code-activator() {
_CA__CHECK_DEPENDENCIES $_CA__DEPENDENCIES || return 1
local COMMAND ARGS
case $1 in
deactivate ) COMMAND=DEACTIVATE ;;
clone ) COMMAND=CLONE; ARGS=(${@:2}) ;;
new ) COMMAND=NEW; ARGS=(${@:2}) ;;
* ) COMMAND=ACTIVATE; ARGS=(${@:1}) ;;
esac
_CA_$COMMAND $ARGS
}
source $_CA/activator.completion.zsh
source $_CA/activator.bindings.zsh