3

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?

1

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
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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