Usually on a Unix/Linux terminal when you press Tab it will auto-complete until there are several options, and then it will list the options below for you to select. For example:
cd he
helpFolder/ helpMe/ heIsThere/
cd help
With the Mac terminal, it forces you to press it twice to see options. I wondering if it's possible to change that setting to one Tab press?
In the Safari app on your Mac, use AutoFill settings to fill in contact information, user names and passwords, credit card information, and other forms on webpages. To change these settings, choose Safari > Settings, then click AutoFill.
Using autocomplete is as simple as pressing the [TAB] and the active command line options will fill-in. If more than one option is available, you can hit [TAB] twice to display all possible choices and continue typing until there is only one matching choice left.
nano ~/.inputrc
Paste the following on separate lines
set completion-ignore-case on
set show-all-if-ambiguous on
TAB: menu-complete
Src: http://osxdaily.com/2012/08/02/improve-tab-completion-in-mac-os-x-terminal/
Put this in your ~/.inputrc
:
set show-all-if-ambiguous on
You'll need to restart your shell (for example by opening a new terminal window or typing exec /bin/bash
).
I am adding a new answer because in my case adding the line set show-all-if-ambiguous on
was not enough.
I had also to remove the line: TAB: menu-complete
.
My complete ~/.inputrc
file is the following:
set completion-ignore-case on
set show-all-if-ambiguous on
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With