We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cd3a48 commit 98ea370Copy full SHA for 98ea370
src/shelloracle/shelloracle.bash
@@ -0,0 +1,20 @@
1
+__shelloracle__() {
2
+ local output
3
+ output=$(python3 -m shelloracle) || return
4
+ READLINE_LINE=${output#*$'\t'}
5
+ if [[ -z "$READLINE_POINT" ]]; then
6
+ echo "$READLINE_LINE"
7
+ else
8
+ READLINE_POINT=0x7fffffff
9
+ fi
10
+}
11
+
12
+if (( BASH_VERSINFO[0] < 4 )); then
13
+ bind -m emacs-standard '"\C-f": "\C-e \C-u\C-y\ey\C-u"$(__shelloracle__)"\e\C-e\er"'
14
+ bind -m vi-command '"\C-f": "\C-z\C-r\C-z"'
15
+ bind -m vi-insert '"\C-f": "\C-z\C-r\C-z"'
16
+else
17
+ bind -m emacs-standard -x '"\C-f": __shelloracle__'
18
+ bind -m vi-command -x '"\C-f": __shelloracle__'
19
+ bind -m vi-insert -x '"\C-f": __shelloracle__'
20
+fi
0 commit comments