# Use cache to speed up completions.
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
-# Ignore case if currently typed string doesn't match.
-zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'
+# Try uppercase if the currently typed string doesn't match. This allows
+# typing in lowercase most of the time and completion fixes the case.
+zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}'
# Ignore completion functions.
zstyle ':completion:*:functions' ignored-patterns '_*'
# Ignore parent directory.
# Make completion lists scrollable so "do you wish to see all n possibilities"
# is no longer displayed.
zstyle ':completion:*' list-prompt '%p'
+# When unsetting variables make sure every variable name is only suggested
+# once.
+zstyle ':completion:*:unset:*' ignore-line yes
+# When working with mercurial don't complete the same file multiple times.
+zstyle ':completion:*:hg*:*' ignore-line yes
# Enable zsh's extended glob abilities.
setopt extendedglob