zsh-autosuggestions/src/start.zsh

25 lines
866 B
Bash
Raw Permalink Normal View History

2016-02-05 23:14:08 +01:00
2016-02-14 08:29:43 +01:00
#--------------------------------------------------------------------#
# Start #
#--------------------------------------------------------------------#
2016-02-05 23:14:08 +01:00
# Start the autosuggestion widgets
_zsh_autosuggest_start() {
add-zsh-hook -d precmd _zsh_autosuggest_start
2016-02-05 23:14:08 +01:00
_zsh_autosuggest_bind_widgets
# Re-bind widgets on every precmd to ensure we wrap other wrappers.
# Specifically, highlighting breaks if our widgets are wrapped by
# zsh-syntax-highlighting widgets. This also allows modifications
# to the widget list variables to take effect on the next precmd.
add-zsh-hook precmd _zsh_autosuggest_bind_widgets
if [[ -n "${ZSH_AUTOSUGGEST_USE_ASYNC+x}" ]]; then
2017-01-27 23:18:26 +01:00
_zsh_autosuggest_async_start
fi
2016-02-05 23:14:08 +01:00
}
2017-01-27 23:18:26 +01:00
# Start the autosuggestion widgets on the next precmd
add-zsh-hook precmd _zsh_autosuggest_start