From 96ccc0561dd119ee5ebe9a590d12f167c3acfbf7 Mon Sep 17 00:00:00 2001 From: reo6 Date: Mon, 10 Feb 2025 15:14:01 +0300 Subject: [PATCH] sgpt shortcut for bash --- .bashrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.bashrc b/.bashrc index 04d5fa1..66ee7b5 100644 --- a/.bashrc +++ b/.bashrc @@ -1,3 +1,13 @@ export PS1="\[$(tput setaf 216)\]\u\[$(tput setaf 160)\]@\[$(tput setaf 202)\]\h \[$(tput setaf 131)\]\w \[$(tput sgr0)\]$ " export PATH=$PATH:~/.local/bin + +# Shell-GPT integration BASH v0.2 +_sgpt_bash() { +if [[ -n "$READLINE_LINE" ]]; then + READLINE_LINE=$(sgpt --shell <<< "$READLINE_LINE" --no-interaction) + READLINE_POINT=${#READLINE_LINE} +fi +} +bind -x '"\C-l": _sgpt_bash' +# Shell-GPT integration BASH v0.2