Hacker News new | ask | show | jobs
by ithcy2 5008 days ago
Everything in the "Context based tab completion" paragraph is already done by bash_completion.

* It knows which commands git takes? Yes. * which hosts are in my hosts file for ssh? Yes. * which users my system have when I write chmod? Yes. * available packages to apt-get? Yes.

Plus everything in /etc/bash_completion, plus the hundreds of additional commands in /etc/bash_completion.d, plus many, many online resources for creating your own...

1 comments

One important difference between how that completion works and zsh's is that zsh cycles between the available completions if you repeatedly type tab. E.g. if you have the files [less01.png, less02.png, less03.png] and type "eog less<tab>" in bash will show you the files. Press tab again and it will list the files again. In zsh, the second tab press would fill in "less01.png", then "less02.png" and so on.

It's a matter of preference which completion strategy is the best, yes. :) But for me I've found that zsh's way to do it saves me many more keystrokes than bash's way.

That is an inputrc configuration not a shell feature.

http://stackoverflow.com/questions/7179642/how-can-i-make-ba...

Yay Unix. Input collection is a pluggabls component.

That almost works. But it seems like you can't have tab to <i>both</i> bring up a list of completions <i>and</i> cycle through completions which zsh does.
Thank you! I knew it was an inputrc setting, but I couldn't find the right one.