Hook up kitty-tool completions with shell integration

This commit is contained in:
Kovid Goyal 2022-09-30 13:39:15 +05:30
parent 74b1cac344
commit 8f5302a650
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 9 additions and 0 deletions

View File

@ -223,6 +223,7 @@ _ksi_main() {
builtin complete -F _ksi_completions kitty builtin complete -F _ksi_completions kitty
builtin complete -F _ksi_completions edit-in-kitty builtin complete -F _ksi_completions edit-in-kitty
builtin complete -F _ksi_completions clone-in-kitty builtin complete -F _ksi_completions clone-in-kitty
builtin complete -F _ksi_completions kitty-tool
fi fi
# wrap our prompt additions in markers we can use to remove them using # wrap our prompt additions in markers we can use to remove them using

View File

@ -0,0 +1,7 @@
function __ksi_completions
set --local ct (commandline --current-token)
set --local tokens (commandline --tokenize --cut-at-cursor --current-process)
printf "%s\n" $tokens $ct | command kitty-tool __complete__ fish
end
complete -f -c kitty-tool -a "(__ksi_completions)"

View File

@ -108,6 +108,7 @@ _ksi_deferred_init() {
compdef _kitty kitty compdef _kitty kitty
compdef _kitty edit-in-kitty compdef _kitty edit-in-kitty
compdef _kitty clone-in-kitty compdef _kitty clone-in-kitty
compdef _kitty kitty-tool
fi fi
# If compdef is not set, compinit has not run yet. In this case we must # If compdef is not set, compinit has not run yet. In this case we must