zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.95k stars 1.86k forks source link

Exclude multiple command from (comp.) autosuggestions #580

Open SkyyySi opened 3 years ago

SkyyySi commented 3 years ago

So this quiet simple: I'd like to be able to exclude more than one command from complrtion suggestions. In my case, that would be pacman (arch package manager), yay (AUR helper) and git. All three cause massive slowdowns when using autosuggestions, sometimes locking my terminal up for a second or two. Per character!

Things I already tried which didn't work:

# seperation with commans
ZSH_AUTOSUGGEST_COMPLETION_IGNORE="pacman -S*,git*"
# -> putting brackets around it
ZSH_AUTOSUGGEST_COMPLETION_IGNORE="(pacman -S*,git*)"
# an array
ZSH_AUTOSUGGEST_COMPLETION_IGNORE=("pacman -S*" "git*")
ericfreese commented 3 years ago

Does the async mode help? https://github.com/zsh-users/zsh-autosuggestions#enable-asynchronous-mode

The completion ignore param is a glob so you can use glob syntax to match multiple patterns. See the docs for the x|y here http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Operators

conwaywong commented 3 years ago

The multiple patterns syntax appears to be a solution as @ericfreese suggested. The following config does not present suggestions for cd or git commands:

SH_AUTOSUGGEST_HISTORY_IGNORE="cd *|git *"