问题
I'm trying to configure my ~/.zshrc so code completion on files/dirs work as I need it. I've found various ressources online on the zstyle completion syntax, and code example but some parts of it are still black magic to me.
So far, here is where I am, after some fiddling 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 it :
zstyle ':completion:*'
means we are going to define a config value for completionmatcher-list
is the config we update, here it defines how zsh match files/dir to suggest'm:{a-zA-Z}={A-Za-z}' 'm:{a-zA-Z}={A-Za-z} l:|=* r:|=*'
are the arguments (values) to pass to thematcher-list
config.- Here I have two arguments, separated by a space. It means zsh will first try to find files that match the first arg, and if it found nothing will try files that match the second arg
And here it becomes fuzzy :
- I get that
'm:{a-zA-Z}={A-Za-z}'
make the match case insensitive but I do not quite understand the syntax. - I also get that
'm:{a-zA-Z}={A-Za-z} l:|=* r:|=*'
still is case insensitive, but also search for the match in the whole string, not just the start. But, I don't get the syntax either.
Can someone confirm my previous assertions, and correct them if needed, as well as detail the voodoo syntax of the arguments ?
Thanks
Edit : Oh, and sorry if the question is more fitted to superuser.com, I had a hard figuring which site was better suited for it.
回答1:
Hi the zsh doc for this is at
http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Matching-Control
来源:https://stackoverflow.com/questions/7906078/how-does-the-matcher-list-arguments-work-in-zsh-zstyle-completion