aichat/scripts/shell-integration/integration.zsh
2024-03-02 08:07:06 +00:00

11 lines
242 B
Bash

_aichat_zsh() {
if [[ -n "$BUFFER" ]]; then
local _old=$BUFFER
BUFFER+="⌛"
zle -I && zle redisplay
BUFFER=$(aichat -e "$_old")
zle end-of-line
fi
}
zle -N _aichat_zsh
bindkey '\ee' _aichat_zsh