zsh-autosuggestions/autosuggestions.zsh
Eric Freese fc3f368acf Cleanup
2016-01-26 20:55:27 -07:00

30 lines
614 B
Bash

#
# Fish-like autosuggestions for zsh
#
# ```zsh
# zle-line-init() {
# autosuggest_start
# }
# zle -N zle-line-init
# ```
unset _ZSH_AUTOSUGGESTION_ACTIVE
LIBDIR="${0:a:h}/lib"
source "$LIBDIR/config.zsh"
source "$LIBDIR/get_suggestion.zsh"
source "$LIBDIR/highlight.zsh"
source "$LIBDIR/widget/widgets.zsh"
source "$LIBDIR/widget/hook.zsh"
autosuggest_start() {
_ZSH_AUTOSUGGESTION_ACTIVE=true
# Register highlighter if needed to support zsh-syntax-highlighting plugin
if _zsh_autosuggest_syntax_highlighting_enabled; then
_zsh_autosuggest_register_highlighter
fi
_zsh_autosuggest_hook_widgets
}