mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2026-06-16 11:36:14 +08:00
See technique used in `fast-syntax-highlighting`:
- ca2e18bbc9
- http://www.zsh.org/mla/users/2018/msg00424.html
21 lines
778 B
Bash
21 lines
778 B
Bash
|
|
#--------------------------------------------------------------------#
|
|
# Start #
|
|
#--------------------------------------------------------------------#
|
|
|
|
# Start the autosuggestion widgets
|
|
_zsh_autosuggest_start() {
|
|
add-zsh-hook -d precmd _zsh_autosuggest_start
|
|
|
|
_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
|
|
}
|
|
|
|
# Start the autosuggestion widgets on the next precmd
|
|
add-zsh-hook precmd _zsh_autosuggest_start
|