]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/frontend-search/_frontend
15f8d239dfbae03aaecec85b020f2e8db360e3e4
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / frontend-search / _frontend
1 #compdef frontend
2
3 zstyle ':completion:*:descriptions' format '%B%d%b'
4 zstyle ':completion::complete:frontend:*:commands' group-name commands
5 zstyle ':completion::complete:frontend:*:frontend_points' group-name frontend_points
6 zstyle ':completion::complete:frontend::' list-grouped
7
8 zmodload zsh/mapfile
9
10 function _frontend() {
11   local CONFIG=$HOME/.frontend-search
12   local ret=1
13
14   local -a commands
15   local -a frontend_points
16
17   frontend_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
18
19   commands=(
20     'angular: Search in Angular.io website'
21     'angularjs: Search in docs.angularjs.org website'
22     'bem: Search in BEM website'
23     'bootsnipp: Search in bootsnipp website'
24     'bundlephobia: Search in Bundlephobia website'
25     'caniuse: Search in Can I Use website'
26     'codepen: Search in codepen website'
27     'compassdoc: Search in COMPASS website'
28     'cssflow: Search in cssflow website'
29     'dartlang: Search in Dart website'
30     'emberjs: Search in Ember website'
31     'flowtype: Search in Flowtype website'
32     'fontello: Search in fontello website'
33     'github: Search in GitHub website'
34     'html5please: Search in HTML5 Please website'
35     'jestjs: Search in Jest website'
36     'jquery: Search in jQuery website'
37     'lodash: Search in Lo-Dash website'
38     'mdn: Search in MDN website'
39     'nodejs: Search in NodeJS website'
40     'npmjs: Search in NPMJS website'
41     'packagephobia: Search in Packagephobia website'
42     'qunit: Search in Qunit website'
43     'reactjs: Search in React website'
44     'smacss: Search in SMACSS website'
45     'stackoverflow: Search in StackOverflow website'
46     'typescript: Search in TypeScript website'
47     'unheap: Search in unheap website'
48     'vuejs: Search in VueJS website'
49   )
50
51   _arguments -C \
52     '1: :->first_arg' \
53     '2: :->second_arg' && ret=0
54
55   case $state in
56     first_arg)
57       _describe -t frontend_points "Warp points" frontend_points && ret=0
58       _describe -t commands "Commands" commands && ret=0
59       ;;
60     second_arg)
61       case $words[2] in
62         jquery)
63           _describe -t points "Warp points" frontend_points && ret=0
64           ;;
65         mdn)
66           _describe -t points "Warp points" frontend_points && ret=0
67           ;;
68         compassdoc)
69           _describe -t points "Warp points" frontend_points && ret=0
70           ;;
71         html5please)
72           _describe -t points "Warp points" frontend_points && ret=0
73           ;;
74         caniuse)
75           _describe -t points "Warp points" frontend_points && ret=0
76           ;;
77         dartlang)
78           _describe -t points "Warp points" frontend_points && ret=0
79           ;;
80         lodash)
81           _describe -t points "Warp points" frontend_points && ret=0
82           ;;
83         qunit)
84           _describe -t points "Warp points" frontend_points && ret=0
85           ;;
86         fontello)
87           _describe -t points "Warp points" frontend_points && ret=0
88           ;;
89         github)
90           _describe -t points "Warp points" frontend_points && ret=0
91           ;;
92         bootsnipp)
93           _describe -t points "Warp points" frontend_points && ret=0
94           ;;
95         cssflow)
96           _describe -t points "Warp points" frontend_points && ret=0
97           ;;
98         codepen)
99           _describe -t points "Warp points" frontend_points && ret=0
100           ;;
101         unheap)
102           _describe -t points "Warp points" frontend_points && ret=0
103           ;;
104         bem)
105           _describe -t points "Warp points" frontend_points && ret=0
106           ;;
107         smacss)
108           _describe -t points "Warp points" frontend_points && ret=0
109           ;;
110         angularjs)
111           _describe -t points "Warp points" frontend_points && ret=0
112           ;;
113         reactjs)
114           _describe -t points "Warp points" frontend_points && ret=0
115           ;;
116         emberjs)
117           _describe -t points "Warp points" frontend_points && ret=0
118           ;;
119         stackoverflow)
120           _describe -t points "Warp points" frontend_points && ret=0
121           ;;
122         npmjs)
123           _describe -t points "Warp points" frontend_points && ret=0
124           ;;
125         bundlephobia)
126           _describe -t points "Warp points" frontend_points && ret=0
127           ;;
128         packagephobia)
129           _describe -t points "Warp points" frontend_points && ret=0
130           ;;
131         flowtype)
132           _describe -t points "Warp points" frontend_points && ret=0
133           ;;
134         typescript)
135           _describe -t points "Warp points" frontend_points && ret=0
136           ;;
137         vuejs)
138           _describe -t points "Warp points" frontend_points && ret=0
139           ;;
140         nodejs)
141           _describe -t points "Warp points" frontend_points && ret=0
142           ;;
143         jestjs)
144           _describe -t points "Warp points" frontend_points && ret=0
145           ;;
146       esac
147       ;;
148   esac
149
150   return $ret
151 }
152
153 _frontend "$@"
154
155 # Local Variables:
156 # mode: Shell-Script
157 # sh-indentation: 2
158 # indent-tabs-mode: nil
159 # sh-basic-offset: 2
160 # End:
161 # vim: ft=zsh sw=2 ts=2 et