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.

I am using zsh. It is a nice shell, especially for the auto completion function. But, when I press tab, it always auto fill with the first completion option. For example, there are two files in my folder.

Mydata.txt
YourData.txt

If I type vim, a blank, then press tab, it will auto fill with Mydata.txt instead of just list them and wait for my input. I do not like to keep on pressing tab to choose the files. It is more easier to press some letters.

I have tried to revise .zshrc and set

unsetopt MENU_COMPLETE

But, it doesn't work.

Could anyone give me some hints?

share|improve this question

migrated from stackoverflow.com Jun 2 '13 at 20:21

This question came from our site for professional and enthusiast programmers.

3 Answers 3

For reference, and as I'm not completely sure, how bash behaves exactly, I quote from the A User's Guide to the Z-Shell by Peter Stephenson, the current maintainer of zsh.

6.2.1 Ambiguous completions

The largest group of options deals with what happens when a completion is ambiguous, in other words there is more than one possible completion. The seven relevant options are as follows, as copied from the FAQ; many different combinations are possible:

  • with NO_BEEP set, that annoying beep goes away,
  • with NO_LIST_BEEP, beeping is only turned off for ambiguous completions,
  • with AUTO_LIST set, when the completion is ambiguous you get a list without having to type CTRL+D,
  • with BASH_AUTO_LIST set, the list only happens the second time you hit tab on an ambiguous completion,
  • with LIST_AMBIGUOUS, this is modified so that nothing is listed if there is an unambiguous prefix or suffix to be inserted -- this can be combined with BASH_AUTO_LIST, so that where both are applicable you need to hit tab three times for a listing,
  • with REC_EXACT, if the string on the command line exactly matches one of the possible completions, it is accepted, even if there is another completion (i.e. that string with something else added) that also matches,
  • with MENU_COMPLETE set, one completion is always inserted completely, then when you hit TAB it changes to the next, and so on until you get back to where you started,
  • with AUTO_MENU, you only get the menu behaviour when you hit TAB again on the ambiguous completion.

You probably want to use (but as I'm said I'm not sure, please feel free to correct me)

setopt BEEP NO_AUTOLIST BASH_AUTOLIST NO_MENUCOMPLETE

where setopt NO_OPTION is equivalent to unset OPTION.

share|improve this answer
up vote 2 down vote accepted

I found a answer by myself. If I set

zstyle ':completion:::*:default' menu no select

Then I can input characters to select the autocomplete options. Though, I can not select by list.

share|improve this answer

I use

 setopt autolist

Does that do what you want?

share|improve this answer
    
Thanks, Jens, I used "setopt auto list, unset MENU_CoMPLETE", but, it does not work. –  HXGuo Jun 3 '13 at 0:08

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.