-
-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Non-interactive mode for --shell and integration changes
- Loading branch information
Showing
7 changed files
with
124 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
bash_integration = """ | ||
# 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 | ||
""" | ||
|
||
zsh_integration = """ | ||
# 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 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters