autosuggestion suppprt
@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
- I think what you want is
menu-complete. Actually the featureautosuggestionsis quite different frommenu-complete. I'm not sure whether a specific name is given for "highlighting in menu-complete". - Highlighting is not available, but you can configure the plain Bash with the following settings for
menu-complete. You don't even needoh-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
- If you want to highlight the selected completion in
menu-complete, I thinkoh-my-bashdoes not support it because it's really complicated to realize it with Bash configurations. But as I have already written first,ble.shdoes support it. Maybe you can also tryble.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.