zsh-users / zsh-autosuggestions

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

zsh-syntax-highlighting: unhandled ZLE widget 'autosuggest-accept' #642

Closed codehia closed 2 years ago

codehia commented 2 years ago

Describe the bug

I am getting this message

zsh-syntax-highlighting: unhandled ZLE widget 'autosuggest-accept'
zsh-syntax-highlighting: (This is sometimes caused by doing `bindkey <keys> autosuggest-accept` without creating the 'autosuggest-accept' widget with `zle -N` or `zle -C`.)

when the terminal is opened.

To Reproduce

Steps to reproduce the behavior:

Desktop

ericfreese commented 2 years ago

Make sure that the bindkey is running after zsh-autosuggestions.zsh has been sourced. You probably want to add the keybinding to the bottom of your .zshrc file itself.

aemonge commented 3 months ago

Just in case a zinit fellow comes here:

    zinit wait lucid light-mode for \
      atload"_zsh_autosuggest_start; \
            ZSH_AUTOSUGGEST_STRATEGY=(history completion) \
            ZSH_AUTOSUGGEST_MANUAL_REBIND=0 \
            ZSH_AUTOSUGGEST_HISTORY_IGNORE=' *' \
            bindkey '^p' history-search-backward; \
            bindkey '^o' history-search-forward; \
            bindkey '^n' autosuggest-accept; \
            bindkey '^e' autosuggest-execute; \
            bindkey '^a' autosuggest-toggle; \
            bindkey '^s' autosuggest-clear" \
      zsh-users/zsh-autosuggestions