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

Re: Setting the 'completer' style - _match and **



On Sep 12, 11:30pm, Daniel Shahaf wrote:
} 
} I've come up with the following:
} .
}     bindkey $'\t' complete-word
}     zstyle ':completion:*' completer _all_matches _match-ds _expand _complete _ignored
}     _match-ds() {
}       [[ $PREFIX$SUFFIX != *[*][*]* ]] && _match "$@"
}     }
} .
} The idea is that if a pattern contains "**" then _match('s wrapper) will
} leave it for _expand to process.
} 
} Is there another way to implement this?

You could probably come up with a "zstyle -e" formulation that would only
include_match in the completer value in the right circurmstances.  I'm not
sure that's a better solution than yours.

I'll note in passing that _match is supposed to be used after _complete,
not before _expand. Might it be better to suppress the _expand completer
in the cases where you want _match rather than the other way around?



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