zsh-autosuggestions/src/start.zsh

22 lines
804 B
Bash
Raw Normal View History

2016-02-05 15:14:08 -07:00
2016-02-14 00:29:43 -07:00
#--------------------------------------------------------------------#
# Start #
#--------------------------------------------------------------------#
2016-02-05 15:14:08 -07:00
# Start the autosuggestion widgets
_zsh_autosuggest_start() {
add-zsh-hook -d precmd _zsh_autosuggest_start
2016-02-05 15:14:08 -07: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
2016-02-05 15:14:08 -07:00
}
2017-01-27 15:18:26 -07:00
# Start the autosuggestion widgets on the next precmd
autoload -Uz add-zsh-hook
add-zsh-hook precmd _zsh_autosuggest_start