How can I get zsh's completion working in the middle of the filename?
As per the comments, I tried disabling oh-my-zsh
, which fixed this problem. I then went through the oh-my-zsh
source, selectively disabling modules.
I previously had CASE_SENSITIVE="true"
, but commenting out this line fixed it for me. Apparently it's a known bug.
To fix it, I could put the following line in ~/.zshrc
after sourcing oh-my-zsh
.
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
Personally, I prefer this solution much more - http://zsh.sourceforge.net/FAQ/zshfaq04.html#l50, It works like completion in tcsh, and completes words, that are before cursor only.
Just use
bindkey '\CI' expand-or-complete-prefix
instead of
bindkey '\CI' expand-or-complete
(Which is by default).