Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running msys 1.0 on Win2K using the rxvt.exe terminal. By default, tab-completion works, but when I do 'set -o vi' to enable vi-readline editing, tab-completion stops working. Surely I can have my cake and eat it too?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

Add this line to your ~/.inputrc:

"\C-i": vi-complete

To enable it in the current session without having to restart it, type this at the Bash prompt:

 bind '"\C-i":vi-complete' 
share|improve this answer
    
Thanks for the suggestion, but I tried both of these and I still have the same problem. –  William Knight Mar 9 '10 at 18:08
    
But wait! After doing the bind command, I found that if I also unchecked 'Quick-Edit' mode in the options tab of the msys.bat properties, then it worked! thanks! –  William Knight Mar 9 '10 at 18:58
add comment

Typing

set -o vi

followed by

bind '"\C-i":complete'

seems to give me the behavior I want (tab tab suggestions, and vi editing behavior). This seems strange to me because

"\C-i":complete

is the default in the ~/.inputrc file.

Adding

"\C-i": vi-complete 

to your

~/.inputrc

seems to work but only if there is a single suggestion, and tab tab does not give you a list of suggestions as it did before. Does anyone have a more complete suggestion?

I tried:

$if mode=vi
      # "\C-i": complete
        "\C-i": vi-complete
$endif

But it as no effect if I switch to vi after I start mingw by typing

set -o vi

Of course

bind '"\C-i":vi-complete'

does work, but tab tab does not show all suggestions, and it only auto-completes if there is but a single suggestion.

share|improve this answer
add comment

After searching the mailing list, I added these lines to the top of my .inputrc file:

set editing-mode vi
TAB: complete

This seems to work for me so far.

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.