zsh Autocomplete – Combining zsh’s tab completion with case insensitivity

autocompletezsh

I have zsh 5.0.7 configured to use case-insensitive tab completion with

zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'

The problem I’m having is that this case insensitivity often leads to my needing to press Tab an extra time. For example, my home directory contains the folders “Desktop”, “Documents”, and “Downloads”. If I’m in my home folder and I type

cd D

and then press Tab, I see the three possibilities listed for me. On the other hand, if I type

cd d

and then press Tab then the “d” changes to “D” but I don’t see the completion menu; I need to press Tab again for that to happen. Is there a way to get the completion menu at the same time that the “d” is changed to a “D”?

Best Answer

Enabling the option MENU_COMPLETE will skip the correction and immediately insert the first possible match.