From 62d0a584b65341dc92bf5e4777c1078f03cb975c Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Wed, 16 Jan 2019 21:00:58 -0500 Subject: [PATCH] kitty completions --- bin/kitty.completion.bash | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 bin/kitty.completion.bash diff --git a/bin/kitty.completion.bash b/bin/kitty.completion.bash new file mode 100644 index 0000000..905cfe4 --- /dev/null +++ b/bin/kitty.completion.bash @@ -0,0 +1,15 @@ + +_kitty_completions() { + local src + local limit + # Send all words up to the word the cursor is currently on + let limit=1+$COMP_CWORD + src=$(printf "%s +" "${COMP_WORDS[@]: 0:$limit}" | kitty +complete bash) + if [[ $? == 0 ]]; then + eval ${src} + fi +} + +complete -o nospace -F _kitty_completions kitty +