diff --git a/zsh/.zshrc b/zsh/.zshrc index f844953..056a41a 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -80,6 +80,7 @@ alias vi="nvim" alias vim="nvim" alias lg="lazygit" alias cc="clear" +alias sgpts="sgpt --shell" # Shell integrations eval "$(fzf --zsh)" @@ -88,6 +89,20 @@ eval "$(zoxide init --cmd cd zsh)" # bun completions [ -s "/home/laurent/.bun/_bun" ] && source "/home/laurent/.bun/_bun" +# Shell-GPT integration ZSH v0.2 +_sgpt_zsh() { +if [[ -n "$BUFFER" ]]; then + _sgpt_prev_cmd=$BUFFER + BUFFER+="⌛" + zle -I && zle redisplay + BUFFER=$(sgpt --shell <<< "$_sgpt_prev_cmd" --no-interaction) + zle end-of-line +fi +} +zle -N _sgpt_zsh +bindkey ^l _sgpt_zsh +# Shell-GPT integration ZSH v0.2 + # bun export BUN_INSTALL="$HOME/.bun" -export PATH="$HOME/go/bin:$BUN_INSTALL/bin:$PATH" +export PATH="$HOME/go/bin:$BUN_INSTALL/bin:$HOME/.local/bin:$PATH"