Is it possible to tell zsh to not autocomplete certain commands when using TAB completion ?


I type chm <tab> and zsh completion offers me two options:

chmem  chmod

I never use chmem. Instead of having two options, I would prefer to have chm automatically completed to chmod.


You can do:

zstyle ':completion:*:*:-command-:*:*' ignored-patterns 'chmem'

If you needed to do more than one ignored pattern, you would do it like this:

zstyle ':completion:*:*:-command-:*:*' ignored-patterns 'chmem|chcpu|chcon'
  • perfect. that works. thanks a lot – Martin Vegter Jul 31 '19 at 7:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.