In zsh, when I type beginning of a filename, and autocomplete with tab:

$ ls gs<tab>

if there is no match starting with gs, I might get:

$ ls logs

Far from being useful, I find this feature actually harmful. I want to know that there is no match in current dir (perhaps I entered the wrong dir mistakenly).

To add insult to injury, the autocompleted/autocorrected filename does not exist either (there is a file bootlogs, but no file logs)

How can I disable this "feature" ? I tried adding following options into my .zshrc, but that did not help:

unsetopt correct
unsetopt correct_all

I have also removed _correct and _approximate from the completer:

zstyle ':completion:*' completer _expand _complete

and here is the matcher-list line:

zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'

I am using zsh 4.3.17, without any included framework (such as oh-my-zsh).

  • Fix the matcher-list style that you set then, if you use r or l with some vague values it happens. – llua Oct 11 '16 at 16:26
  • @llua - thatnks. Rremoving the matcher-list line seems to do the trick. – 400 the Cat Oct 11 '16 at 18:00
  • Since you're pressing Tab, that's a completion setting, not related to autocorrect. I think there's an option for that in compinstall, if you don't want to figure out what value of matcher-list would suit you. – Gilles Oct 11 '16 at 23:40
  • @Gilles - how come completion works, even if I remove the whole matcher-list line? It seems to have same effect as leaving only zstyle ':completion:*' matcher-list ''. Is that the default setting? – 400 the Cat Oct 12 '16 at 6:57
  • @400theCat Yes: the completion code does zstyle -a ":completion:${curcontext}:" matcher-list _matchers || _matchers=( '' ) – Gilles Oct 12 '16 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.