terminitor plugin
Robby Russell authored on 10/10/2011 at 12:38:571 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,38 @@ |
0 |
+#compdef terminitor |
|
1 |
+#autoload |
|
2 |
+ |
|
3 |
+# terminitor zsh completion |
|
4 |
+ |
|
5 |
+_terminitor_available_scripts() { |
|
6 |
+ scripts=(`for SCRIPT in ~/.config/terminitor/*.term ; do basename $SCRIPT .term ; done`) |
|
7 |
+} |
|
8 |
+ |
|
9 |
+local -a _1st_arguments |
|
10 |
+_1st_arguments=( |
|
11 |
+ 'create:create a Termfile in directory' |
|
12 |
+ 'delete:delete terminitor script' |
|
13 |
+ 'edit:open termitor script' |
|
14 |
+ 'fetch:clone the designated repo and run setup' |
|
15 |
+ 'help:Describe available tasks or one specific task' |
|
16 |
+ 'init:create initial root terminitor folder' |
|
17 |
+ 'list:lists all terminitor scripts' |
|
18 |
+ 'setup:execute setup in the terminitor script' |
|
19 |
+ 'start:runs the terminitor script' |
|
20 |
+ 'update:update Terminitor to new global path(.config/.terminitor)' |
|
21 |
+) |
|
22 |
+ |
|
23 |
+local expl |
|
24 |
+ |
|
25 |
+_arguments \ |
|
26 |
+ '*:: :->subcmds' && return 0 |
|
27 |
+ |
|
28 |
+if (( CURRENT == 1 )); then |
|
29 |
+ _describe -t commands "terminitor task" _1st_arguments |
|
30 |
+ return |
|
31 |
+fi |
|
32 |
+ |
|
33 |
+case "$words[1]" in |
|
34 |
+ start|edit|delete|setup) |
|
35 |
+ _terminitor_available_scripts |
|
36 |
+ _wanted scripts expl 'installed scripts' compadd -a scripts ;; |
|
37 |
+esac |