1 2 3 4 5 6 7 8 9 10 11 12 13 14
autoload -Uz compinit compinit _kitty() { local src # Send all words up to the word the cursor is currently on src=$(printf "%s " "${(@)words[1,$CURRENT]}" | kitty +complete zsh) if [[ $? == 0 ]]; then eval ${src} fi } compdef _kitty kitty