Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

String partial match from both left and right.



Hi everyone,

I have this super simple zsh completion function.

function hello() {
    arg=${@[1]}
    echo $arg
}
function _hello {
    _values -s ' ' 'dashboards' foo bar foo-bar
}
compdef _hello hello

And what I want is, if I do:-

$hello bar<TAB>

I want `foo-bar` to come in the completion menu. I figured that it has
something to do with mater-list but I can't seem to get it working.

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

Let me know if you guys need any more debugging info. I've been scratching
my head on this one but can't get it to work.

-- 
Cheers,
Abhijeet Rastogi (shadyabhi)


Messages sorted by: Reverse Date, Date, Thread, Author