zsh-autosuggestions
zsh-autosuggestions copied to clipboard
Only display unambiguous suggestions
I set ZSH_AUTOSUGGEST_STRATEGY=(completion) and would like to configure zsh-autosuggestions or zsh itself so that only unambiguous suggestions are displayed. e.g. cd D would show no suggestion (because D matches both ~/Desktop and ~/Downloads), but cd De would show the completion sktop/. Is this possible?
I've had a look at the zsh documentation and the code for this plugin, but I have to admit that I'm a little lost. Any help would be much appreciated. Thanks!
It's not possible in an official way right now. I'll have to think about the best way to support this use case.
The ambiguous suggestions are forced by setting compstate[insert] in _zsh_autosuggest_capture_postcompletion so as a temporary workaround you can redefine that function after sourcing the plugin (but you probably shouldn't do this long-term since that's a private function that may change without warning in future versions):
_zsh_autosuggest_capture_postcompletion() {
unset 'compstate[list]'
}
Thanks! That's a great workaround. If you support this officially please post something here :)
Big fan of this request! I am looking forward to the official support.