Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autosuggestion suppprt #108

Open
meilihao opened this issue Sep 29, 2019 · 9 comments
Open

autosuggestion suppprt #108

meilihao opened this issue Sep 29, 2019 · 9 comments

Comments

@meilihao
Copy link

like zsh-users/zsh-autosuggestions

@nntoan
Copy link
Member

nntoan commented Sep 30, 2019

@meilihao That's impossible for Bash actually.

@opyate
Copy link

opyate commented Nov 6, 2019

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.)

@akinomyoga
Copy link
Contributor

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 feature autosuggestions is quite different from menu-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 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
  • If you want to highlight the selected completion in 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.

@opyate
Copy link

opyate commented Jan 2, 2020

@akinomyoga thanks so much for taking the time to reply. I'll try your suggestions some time.

@rashil2000
Copy link

@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.

@meilihao
Copy link
Author

meilihao commented Sep 23, 2020

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.

@alanhe421
Copy link

@meilihao That's impossible for Bash actually.

warp did it.
https://www.warp.dev/

@akinomyoga
Copy link
Contributor

akinomyoga commented Jun 10, 2024

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.

@epignatelli
Copy link

This is such a deterrent to migrate from oh-my-zsh to oh-my bash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants