How do matcher-list arguments work in zsh zstyle?

I am trying to customize my ~ / .zshrc file, so the code execution on the / dirs files works as I need. I found various ressources on the Internet for zstyle completion syntax and sample code, but some parts of it are still black magic.

So far I'm here, after some attempts and testing:

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

Here is what I understand from this:

  • zstyle ':completion:*' means we're going to determine the configuration value to complete
  • matcher-list is the configuration we are updating, here it defines how zsh match files / dir offers
  • 'm:{a-zA-Z}={A-Za-z}' 'm:{a-zA-Z}={A-Za-z} l:|=* r:|=*'- these are the arguments (values) that need to be passed to the configuration matcher-list.
  • Here I have two arguments separated by a space. This means that zsh will first try to find the files matching the first arg, and if it doesn't find anything, it will try the files matching the second arg

And here it becomes fuzzy:

  • I get that 'm:{a-zA-Z}={A-Za-z}'makes the case-insensitive insensitive, but I don't quite understand the syntax.
  • I also understand that it 'm:{a-zA-Z}={A-Za-z} l:|=* r:|=*'is still case insensitive, but also looking for a match on the entire string, not just the beginning. But I don't get the syntax either.

Can someone confirm my previous statements and correct them if necessary, as well as detail the syntax of the Voodoo arguments?

thank

Edit: Oh, and I'm sorry if the question is more suitable for superuser.com, I had a tough definition of which site is best for it.

+5

All Articles