@@ -0,0 +1,29 @@
1+#compdef _hx hx
2+# Zsh completion script for Helix editor
3+
4+_hx() {
5+ _arguments -C \
6+ "-h[Prints help information]" \
7+ "--help[Prints help information]" \
8+ "-v[Increase logging verbosity]" \
9+ "-vv[Increase logging verbosity]" \
10+ "-vvv[Increase logging verbosity]" \
11+ "-V[Prints version information]" \
12+ "--version[Prints version information]" \
13+ "--tutor[Loads the tutorial]" \
14+ "--health[Checks for errors in editor setup]:language:->health" \
15+ "-g[Fetches or builds tree-sitter grammars]:action:->grammar" \
16+ "--grammar[Fetches or builds tree-sitter grammars]:action:->grammar" \
17+ "*:file:_files"
18+
19+ case "$state" in
20+ health)
21+ local languages=($(hx --health |tail -n '+7' |awk '{print $1}' |sed 's/\x1b\[[0-9;]*m//g'))
22+ _values 'language' $languages
23+ ;;
24+ grammar)
25+ _values 'action' fetch build
26+ ;;
27+ esac
28+}
29+