Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Whenever I use tab-completion, the list of possibilities is displayed and the prompt is duplicated below (| indicates the final cursor position):

$ vim ~/.<TAB>
./    ../    .bashrc    .vimrc
$ vim ~/.|

I would like the following, zsh-like behavior:

$ vim ~/.<TAB>|
./    ../    .bashrc    .vimrc

That is, show the suggestions below the old prompt. Old suggestions should be overwritten or vanish once I'm done completing instead of cluttering my screen.

Is this possible? If so, how?

share|improve this question
add comment

1 Answer

While bash does not have a perfect match for the zsh completion menu, you can cut down on screen clutter with menu-complete bindings in your .bashrc:

bind '\C-n:menu-complete'
bind '\C-p:menu-complete-previous'

These bindings cycle through completions on the commmand line with Ctrl+N and Ctrl+P (without showing the complete list). Your system may already have these keys bound; to check:

bind -p | grep menu-complete
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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