zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.33k stars 1.85k forks source link

How should I change my autosuggestions config? #695

Closed bluebambu closed 1 year ago

bluebambu commented 2 years ago

Hi, I install zsh-autosuggestions with manual installation method. I'm trying to change the config to change the suggesting strategy. How exactly should I change it? do I need to do things like this?

# Strategies to use to fetch a suggestion
# Will try each strategy in order until a suggestion is returned
(( ! ${+ZSH_AUTOSUGGEST_STRATEGY} )) && {
    typeset -ga ZSH_AUTOSUGGEST_STRATEGY
    ZSH_AUTOSUGGEST_STRATEGY=(history)
}
ZSH_AUTOSUGGEST_STRATEGY=(completion)  <<<----

I tried and it seems not working...

And I also wonder, after I modify the config.zsh file, how do I make it active? source xxx/zsh-autosuggestions.zsh seems not working for me.

thanks.

ic-768 commented 1 year ago

You shouldn't edit config.zsh.

If you have a .zshrc file you can add all your configuration there. Alternatively, you can use any other file that is sourced by the terminal, e.g. .bashrc or .bash_profile

Adding ZSH_AUTOSUGGEST_STRATEGY=(completion) in any one of those files should work.