fork/helix

git clone https://git.julia.blue/fork/helix

David ElseFix ZSH completions (#11133)a75b1cf5

24.07
1.2 KiB35 linesraw
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		"--vsplit[Splits all given files vertically]" \
18		"--hsplit[Splits all given files horizontally]" \
19		"-c[Specifies a file to use for configuration]" \
20		"--config[Specifies a file to use for configuration]" \
21		"-w[Specify initial working directory]" \
22		"--working-dir[Specify initial working directory]" \
23		"--log[Specifies a file to use for logging]" \
24		"*:file:_files"
25
26	case "$state" in
27	health)
28		local languages=($(hx --health | tail -n '+11' | awk '{print $1}' | sed 's/\x1b\[[0-9;]*m//g;s/[✘✓]//g'))
29		_values 'language' $languages
30		;;
31	grammar)
32		_values 'action' fetch build
33		;;
34	esac
35}