zsh-autosuggestions icon indicating copy to clipboard operation
zsh-autosuggestions copied to clipboard

ZSH_AUTOSUGGEST_STRATEGY=(history completion) not working with `bindkey`

Open xmlking opened this issue 2 years ago • 2 comments

I have following in my ~/.zshrc

ZSH_AUTOSUGGEST_STRATEGY=(history completion) not working with bindkey

# zsh-autosuggestions
if [[ -f "$(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh" ]]; then
	# will first try to find a suggestion from your history, but,
	# if it can't find a match, will find a suggestion from the completion engine.
	export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
	source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
	# Search Previous Used Commands using arrows
	# up and down arrows - history search
	autoload -U history-search-end
	zle -N history-beginning-search-backward-end history-search-end
	zle -N history-beginning-search-forward-end history-search-end
	bindkey "^[[A" history-beginning-search-backward-end
	bindkey "^[[B" history-beginning-search-forward-end
fi

When I press arrow key UP/DOWN keys, I only get suggestions form History. not from completion options.

image

xmlking avatar Mar 03 '22 02:03 xmlking

I have the same problem

gnoluv9x avatar Mar 05 '22 14:03 gnoluv9x

I think there is a built-in binding for cycle through completions options with Ctrl + i but it nullify the easyness of having Key UP/DOWN to cycle through history + completion options.

xmlking avatar Mar 05 '22 17:03 xmlking