ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.59k stars 628 forks source link

autosuggestion suppprt #108

Open meilihao opened 4 years ago

meilihao commented 4 years ago

like zsh-users/zsh-autosuggestions

nntoan commented 4 years ago

@meilihao That's impossible for Bash actually.

opyate commented 4 years ago

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 commented 4 years ago

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

# 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
opyate commented 4 years ago

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

rashil2000 commented 3 years ago

@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 commented 3 years ago

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 commented 1 month ago

@meilihao That's impossible for Bash actually.

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

akinomyoga commented 1 month ago

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.