2016-02-06 06:14:08 +08:00
|
|
|
|
2016-02-14 15:29:43 +08:00
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# Start #
|
|
|
|
#--------------------------------------------------------------------#
|
2016-02-06 06:14:08 +08:00
|
|
|
|
|
|
|
# Start the autosuggestion widgets
|
2016-02-08 05:21:57 +08:00
|
|
|
_zsh_autosuggest_start() {
|
2019-04-11 01:41:20 +08:00
|
|
|
# By default we 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. However this has
|
|
|
|
# a decent performance hit, so users can set ZSH_AUTOSUGGEST_MANUAL_REBIND
|
|
|
|
# to disable the automatic re-binding.
|
|
|
|
if (( ${+ZSH_AUTOSUGGEST_MANUAL_REBIND} )); then
|
|
|
|
add-zsh-hook -d precmd _zsh_autosuggest_start
|
|
|
|
fi
|
2017-02-19 01:47:53 +08:00
|
|
|
|
2016-02-06 06:14:08 +08:00
|
|
|
_zsh_autosuggest_bind_widgets
|
|
|
|
}
|
2016-02-08 05:21:57 +08:00
|
|
|
|
2017-01-28 06:18:26 +08:00
|
|
|
# Start the autosuggestion widgets on the next precmd
|
2016-02-08 05:21:57 +08:00
|
|
|
add-zsh-hook precmd _zsh_autosuggest_start
|