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 the matcher-list
config.And here it becomes fuzzy :
'm:{a-zA-Z}={A-Za-z}'
make the match case insensitive but I do not quite understand the syntax.'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.
zstyle is defined by the zsh/util module, this simply means that the code which defines how to parse, and "do" zstyle is defined in the zsh/zutil module. You could just as well forget this fact, i.e. bash doesn't require you to know that the code for the eval builtin is contained in the file eval.
When you hit the tab key, the system will complete the path to the Documents folder. At this point, you can add a character or two to get to a unique completion, and hit the tab key again. In zsh you can also hit the tab key repeatedly to cycle through the suggested completions.
The compinit file defines the following functions, which may also be called directly by the user. The first form tells the completion system to call the given function when completing for the contexts or commands whose names are given: this is like the #compdef tag.
Hi the zsh doc for this is at
http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Matching-Control
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With