zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
31.4k stars 1.87k forks source link

Temporarily disable autosuggestions after whitespace characters? #480

Open xoihiox opened 4 years ago

xoihiox commented 4 years ago

The plugin currently auto-suggests \[ on blank lines for every whitespace character. It is just a cosmetic thing, but I don't like it.

My zsh currently auto-inserts a space after every completion, and zsh-autosuggestions will autosuggest in all of these instances as well. But, in >50% of these cases, I do not want an additional completion, and I just want to open the tab-completed file in vim, for instance.

Maybe this is a little clearer:

  1. vim file1<tab> autocompletes to vim file1.txt <space><autosuggestion>file2.txt</autosuggestion>

Can I disable autosuggestions on whitespace characters (and for a single keystroke after all tab-completions), and re-enable for all other keypresses, or something like that? Or maybe you have other suggestions to fix my configuration?

I tried bindkey " " autosuggest-disable but it eats up my space.

Thanks.

ericfreese commented 4 years ago

I just put up a pull request adding a new ZSH_AUTOSUGGEST_COMPLETION_IGNORE config option that you may be able to use to get the behavior you want. Please try out branch features/completion-ignore (PR #487).