Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently ZSH displays a menu when I first hit tab and the completion is ambiguous. So, if I have 'cd ' in the command prompt and I hit tab, it will show the different available completions. If I hit tab again, it will select the first available completion.

I would like to merge these two steps into a single press of the tab key. So, if I'm at 'cd ' and I tab, I would like ZSH to insert the first available match (when ambiguous) and display the menu, which I can then tab through if the first match wasn't the directory I had in mind.

The ZSH setup tool put this in my .zshrc, in case any of this is affecting the behavior of my shell:

zstyle ':completion:*' completer _expand _complete _ignored
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
zstyle ':completion:*' menu select=5
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle :compinstall filename '/home/robb/.zshrc'
share|improve this question

migrated from stackoverflow.com Apr 29 '11 at 9:32

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

Add this line to your ~/.zshrc: setopt menu_complete See man zshoptions for details. – yibe Apr 23 '11 at 17:06

Add this line to your ~/.zshrc:

setopt menu_complete

See man zshoptions for details.

share|improve this answer

Your Answer


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.