mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
30 lines
614 B
Bash
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
|
|
}
|