Search code examples
gitzshzsh-completion

Case insensitive completion for git in zsh


I have zsh setup to do case insensitive completion but somehow file matching for git completion remains case sensitive:

% zsh -f
% autoload -U compinit && compinit
% zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
% setopt nocasematch
% touch Foo
% ls fo[TAB]
% ls Foo # completes to foo
Foo
% git add fo[TAB] # does not complete

Any ideas?


Solution

  • Solution: take _git from Zsh's 'master' branch. Latest version of Zsh today is 5.0.5, zsh's master I took _git from is at commit c8e5be9d0fbbc6fb1cf06175b7c3d4757f6d973c.

    Repository is at git://git.code.sf.net/p/zsh/code.

    With these unreleased changes completion for git-add is case insensitive.

    At Zsh-5.0.5 stuff like git-diff is case insensitive but git-add is not.