mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-11 09:55:04 +03:00
130793dfd0
* Add command line parameter to specify log file I had the logs of my debug helix mixed in with the logs from the production helix. Add a `--log` command line argument to redirect any logs to other files, making my debugging easier :-) * Update completion files with `--log` argument
35 lines
1.1 KiB
Bash
35 lines
1.1 KiB
Bash
#compdef _hx hx
|
|
# Zsh completion script for Helix editor
|
|
|
|
_hx() {
|
|
_arguments -C \
|
|
"-h[Prints help information]" \
|
|
"--help[Prints help information]" \
|
|
"-v[Increase logging verbosity]" \
|
|
"-vv[Increase logging verbosity]" \
|
|
"-vvv[Increase logging verbosity]" \
|
|
"-V[Prints version information]" \
|
|
"--version[Prints version information]" \
|
|
"--tutor[Loads the tutorial]" \
|
|
"--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]" \
|
|
"-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]" \
|
|
"*:file:_files"
|
|
|
|
case "$state" in
|
|
health)
|
|
local languages=($(hx --health |tail -n '+7' |awk '{print $1}' |sed 's/\x1b\[[0-9;]*m//g'))
|
|
_values 'language' $languages
|
|
;;
|
|
grammar)
|
|
_values 'action' fetch build
|
|
;;
|
|
esac
|
|
}
|
|
|