From ff0ec15e065957a0da197711f6e3adfb9992325a Mon Sep 17 00:00:00 2001 From: sigoden Date: Mon, 26 Feb 2024 11:28:25 +0800 Subject: feat: add shell integration (#323) --- scripts/integration.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 scripts/integration.zsh (limited to 'scripts/integration.zsh') diff --git a/scripts/integration.zsh b/scripts/integration.zsh new file mode 100644 index 0000000..2328bd6 --- /dev/null +++ b/scripts/integration.zsh @@ -0,0 +1,11 @@ +_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 \ No newline at end of file -- cgit v1.2.3