A post-modern development environment.
1.3 kB
36 lines
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 "--strict[Bail on error for commands that can fail]" \
9 "-v[Increase logging verbosity]" \
10 "-vv[Increase logging verbosity]" \
11 "-vvv[Increase logging verbosity]" \
12 "-V[Prints version information]" \
13 "--version[Prints version information]" \
14 "--tutor[Loads the tutorial]" \
15 "--health[Checks for errors in editor setup]:language:->health" \
16 "-g[Fetches or builds tree-sitter grammars]:action:->grammar" \
17 "--grammar[Fetches or builds tree-sitter grammars]:action:->grammar" \
18 "--vsplit[Splits all given files vertically]" \
19 "--hsplit[Splits all given files horizontally]" \
20 "-c[Specifies a file to use for configuration]" \
21 "--config[Specifies a file to use for configuration]" \
22 "-w[Specify initial working directory]" \
23 "--working-dir[Specify initial working directory]" \
24 "--log[Specifies a file to use for logging]" \
25 "*:file:_files"
26
27 case "$state" in
28 health)
29 local languages=($(hx --health all-languages | tail -n '+2' | awk '{print $1}' | sed 's/\x1b\[[0-9;]*m//g;s/[✘✓]//g'))
30 _values 'language' $languages
31 ;;
32 grammar)
33 _values 'action' fetch build
34 ;;
35 esac
36}