I'd like for bash to rotate through the matching file names instead of listing them, like the default tab completion behavior in vim. Is there an easy command to do this? This is essentially the opposite of this question.

link|improve this question
feedback

1 Answer

up vote 6 down vote accepted

Map Tab to menu-complete.

In your ~/.inputrc:

"\C-i": menu-complete

Re-read the file to make it effective in the current shell by pressing Ctrl-x Ctrl-r.

You can use the following command at a command prompt to enable the feature for the current session if you'd like to test it without editing the ~/.inputrc file, for example.

bind "\C-i" menu-complete
link|improve this answer
Does Ctrl-x Ctrl-r give any feedback indicating that it executed? I'm following your suggestions exactly, but the behavior doesn't change. This is on a terminal via SSH, but I don't think that should affect anything. – thebossman Feb 25 '11 at 1:26
Run bind '"\C-i" menu-complete' on a terminal to test it. (Needs ' quotes) – Eelvex Feb 25 '11 at 1:28
1  
@AdamBossy: No, there's no feedback. – Dennis Williamson Feb 25 '11 at 1:54
1  
@AdamBossy: You must not be using Bash. What does pressing Ctrl-x Ctrl-v tell you? What does echo "$SHELL" tell you? What about ps -p $$`? – Dennis Williamson Feb 25 '11 at 2:19
1  
@AdamBossy: I'm sorry, I made a mistake in my answer. The line in the ~/.inputrc file should not have the bind command. It should simply be "\C-i" menu-complete. I'll edit my answer. – Dennis Williamson Feb 25 '11 at 3:56
show 3 more comments
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.