Unnamed repository; edit this file 'description' to name the repository.
Update ZSH completions (#11120)
David Else 2024-07-11
parent 649bd45 · commit 9d75385
-rw-r--r--contrib/completion/hx.zsh12
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/completion/hx.zsh b/contrib/completion/hx.zsh
index aaad6f84..be380f50 100644
--- a/contrib/completion/hx.zsh
+++ b/contrib/completion/hx.zsh
@@ -1,4 +1,4 @@
-#compdef _hx hx
+compdef _hx hx
# Zsh completion script for Helix editor
_hx() {
@@ -14,16 +14,18 @@ _hx() {
"--health[Checks for errors in editor setup]:language:->health" \
"-g[Fetches or builds tree-sitter grammars]:action:->grammar" \
"--grammar[Fetches or builds tree-sitter grammars]:action:->grammar" \
- "--vsplit[Splits all given files vertically into different windows]" \
- "--hsplit[Splits all given files horizontally into different windows]" \
+ "--vsplit[Splits all given files vertically]" \
+ "--hsplit[Splits all given files horizontally]" \
"-c[Specifies a file to use for configuration]" \
"--config[Specifies a file to use for configuration]" \
- "--log[Specifies a file to write log data into]" \
+ "-w[Specify initial working directory]" \
+ "--working-dir[Specify initial working directory]" \
+ "--log[Specifies a file to use for logging]" \
"*:file:_files"
case "$state" in
health)
- local languages=($(hx --health |tail -n '+7' |awk '{print $1}' |sed 's/\x1b\[[0-9;]*m//g'))
+ local languages=($(hx --health | tail -n '+11' | awk '{print $1}' | sed 's/\x1b\[[0-9;]*m//g;s/[✘✓]//g'))
_values 'language' $languages
;;
grammar)