Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make Bash' tab complete automatically cycle through options OSX

Currently when I'm in my home folder and I want to cd into Documents I type cd D and hit Tab, Bash shows me the list of folders that match D.

What I want to occur is when I press Tab, bash autocompletes with the first option that matches what I've put in and each time I press Tab it cycles through to the next option.

Is there any way to do this? I thought for sure my copy of Bash on my old Ubuntu box had this feature.

like image 947
user1443362 Avatar asked Jun 07 '12 23:06

user1443362


People also ask

How do you autocomplete in Bash?

Bash completion is a bash function that allows you to auto complete commands or arguments by typing partially commands or arguments, then pressing the [Tab] key. This will help you when writing the bash command in terminal.

How does tab completion work Bash?

The programmable completion feature in Bash permits typing a partial command, then pressing the [Tab] key to auto-complete the command sequence. [1] If multiple completions are possible, then [Tab] lists them all.

What is completion script?

The completion script is code that uses the builtin Bash command complete to define which completion suggestions can be displayed for a given executable. The nature of the completion options vary, from simple static to highly sophisticated.


1 Answers

Yes! I found the answer to the question at the following link at MacWorld

put the following in .bashrc or .bash_login

bind '"\t":menu-complete' 
like image 80
xizdaqrian Avatar answered Oct 11 '22 19:10

xizdaqrian