fork/helix

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

Max Hillebash completion: use builtin filenames option (#4648)64359f8b

23.05
586 B23 linesraw
1#!/usr/bin/env bash
2# Bash completion script for Helix editor
3
4_hx() {
5	# $1 command name
6	# $2 word being completed
7	# $3 word preceding
8	COMPREPLY=()
9
10	case "$3" in
11	-g | --grammar)
12		COMPREPLY=($(compgen -W "fetch build" -- $2))
13		;;
14	--health)
15		local languages=$(hx --health |tail -n '+7' |awk '{print $1}' |sed 's/\x1b\[[0-9;]*m//g')
16		COMPREPLY=($(compgen -W "$languages" -- $2))
17		;;
18	*)
19		COMPREPLY=($(compgen -fd -W "-h --help --tutor -V --version -v -vv -vvv --health -g --grammar --vsplit --hsplit -c --config --log" -- $2))
20		;;
21	esac
22} && complete -o filenames -F _hx hx
23