4 # https://dev.0x50.de/projects/ftzsh/repository/revisions/master/entry/functions/_hl_complete
6 function _hl_themes() {
9 themes=(${${${(f)"$(LC_ALL=C highlight --list-themes)"}/ #/}:#*(Installed|Use name)*})
10 _wanted -C list themes expl theme compadd ${themes}
13 function _hl_languages() {
14 local dir expl curcontext="$curcontext"
16 zstyle -s ":completion:${curcontext}:" theme-directory dir \
17 || dir='/usr/share/highlight/langDefs/'
18 langs=( $dir/*(.:t:r) )
19 _wanted -C list languages expl languages compadd ${langs}
22 function _hl_complete () {
25 '(--help -h)'{--help,-h}'[display help text]'
26 '(-c --cat --no-pager)'{--no-pager,--cat,-c}'[do not use a pager]'
27 '(--format -F)'{--format,-F}'[specify output format]'
28 '(--list -l)'{--list,-l}'[list available languages]'
29 '(--pager -P)'{--pager,-P}'[specify which pager to use]'
30 '(--syntax -s)'{--syntax,-s}'[specify which syntax to assume]:languages:_hl_languages'
31 '(--themes -t)'{--themes,-t}'[list available themes]'
32 '(--theme -T)'{--theme,-T}'[specify which theme to use]:themes:_hl_themes'