zsh-users / zsh-history-substring-search

🐠 ZSH port of Fish history search (up arrow)
2.61k stars 156 forks source link

Errors: No such widget `history-substring-search-up' && No such widget `history-substring-search-down' #118

Open johntdavis84 opened 3 years ago

johntdavis84 commented 3 years ago

Hello! I'm running into an issue getting this to work correctly, using antigen + oh-my-zsh. Antigen shows the plugin loaded correctly (at least, I assume that's what https://github.com/robbyrussell/oh-my-zsh.git plugins/zsh-history-substring-search plugin true means in the antigen list --long output).

But when I try the keys I bound, I get the widget errors. What am I doing wrong?

Here's my .antigenrc: Apologies if it looks a bit strange. I had to cut out all the comments because I can't figure out how to get GitHub not to treat them as Markdown.

source /usr/share/zsh/share/antigen.zsh # Load Antigen export ADOTDIR=$HOME/.zsh/.antigen # Set location of Antigen's data directory export ANTIGEN_LOG=$HOME/.zsh/.antigen/logfile # Set location of Antigen's log file (enables logging)

antigen use oh-my-zsh # use oh-my-zsh plugin antigen bundle zsh-users/zsh-autosuggestions # Fish-like autosuggestions for ZSH ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ffffff,bg=#0000ff,bold,underline" # white-on-blue ZSH_AUTOSUGGEST_USE_ASYNC=1 # async suggestions on

antigen bundle zsh-users/zsh-completions # Add additional completions for ZSH antigen bundle zsh-history-substring-search # Add substring search for ZSH

antigen bundle git # load git plugin antigen bundle docker # load docker plugin antigen bundle docker-compose # load docker-compose plugin

if [[ "$OSTYPE" == "darwin"* ]]; then # load osx plugin, but only for Mac OS systems antigen bundle osx fi

antigen bundle zsh-users/zsh-syntax-highlighting # Fish-like syntax highlighting -- MUST BE LAST SOURCED PLUGIN

antigen theme romkatv/powerlevel10k # Apply Powerlevel10k Theme

https://github.com/romkatv/powerlevel10k

antigen apply

bindkey '^[OP' history-substring-search-up # F1 bindkey '^[OQ' history-substring-search-down # F2 bindkey '^ ' autosuggest-execute # Ctrl + SPACE

bindkey '^[[C' autosuggest-accept # Alt + right arrow

[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

h0adp0re commented 3 years ago

Try moving zsh-syntax-highlighting to the very end of the file.

OR

Try moving your bindkey definitions before any plugins.