Open meilihao opened 4 years ago
@meilihao That's impossible for Bash actually.
What do you call it when you double-TAB and the first option is highlighted, and TAB again to highlight the second option?
E.g.
$ ls
foo/ bar/
$ cd <TAB TAB>
[foo/] bar/
<ANOTHER TAB>
foo/ [bar/]
I use square brackets, but it might be a highlight colour.
So, what is that called, and does oh-my-bash support it? (I thought it might have something to do with "suggest" hence posting here.)
I'm developing a bash configuration ble.sh
and found this question today. Actually ble.sh
provides both auto-complete
(like zsh-autosuggestions
) (in Bash 4.0+) and menu-complete
with highlighting of the selected completion. ble.sh
is completely orthogonal to oh-my-bash
(i.e., ble.sh
provides basic line-editor functionalities but does not provide settings of prompts, aliases and functions), so that you can load both ble.sh
and oh-my-bash
in ~/.bashrc
if you like.
@meilihao Maybe you can try ble.sh
for autosuggestions in Bash (which is called auto-complete
in ble.sh
). auto-complete
generates a possible completion from command histories and also from normal completions.
@opyate
menu-complete
. Actually the feature autosuggestions
is quite different from menu-complete
. I'm not sure whether a specific name is given for "highlighting in menu-complete".menu-complete
. You don't even need oh-my-bash
(See also Bash autocomplete: first list files then cycle through them - Unix & Linux Stack Exchange).# In bashrc
bind 'TAB: menu-complete'
bind 'set show-all-if-ambiguous on'
# Or, in inputrc
TAB: menu-complete
set show-all-if-ambiguous on
menu-complete
, I think oh-my-bash
does not support it because it's really complicated to realize it with Bash configurations. But as I have already written first, ble.sh
does support it. Maybe you can also try ble.sh
.@akinomyoga thanks so much for taking the time to reply. I'll try your suggestions some time.
@akinomyoga I checked out ble.sh
today. It's really awesome! Kudos.
I'd be great if oh-my-bash
had a plugin sort of thing for ble.sh
so that it can be optionally enabled, eliminating the need to install both oh-my-bash
and ble.sh
separately.
I tried ble.sh, but i still like zsh-users/zsh-autosuggestions. Because there is a little delay in ble.sh's response, and better experience in zsh-autosuggestions.
@meilihao That's impossible for Bash actually.
warp did it. https://www.warp.dev/
Maybe we should summarize the frameworks that attempt to provide autosuggestions for Bash. There are at least fourfive as far as I know.
ble.sh, fig, linecomp, warp, and inshellisence.
like zsh-users/zsh-autosuggestions