13

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”?

bdesham
  • 1,307
  • 2
  • 13
  • 23

3 Answers3

15

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

llua
  • 6,900
  • 6
    Thanks for the tip! For those wondering, like I was, the full command is setopt MENU_COMPLETE, needs to be placed in .zshrc – cbcoutinho Dec 04 '17 at 22:25
4

Another useful setting could be

setopt no_list_ambiguous

It will correct "c" to "C" and show the completion menu.

Shaoyun
  • 41
0

The OP and the answers didn't work for me. The top answer here works fine:


put these lines in your zsh config file, usually ~/.zshrc:

autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
AdminBee
  • 22,803
Marcin
  • 1