2016-01-27 04:51:44 +01:00
|
|
|
#
|
|
|
|
# Fish-like autosuggestions for zsh
|
2013-10-26 20:05:12 +02:00
|
|
|
#
|
|
|
|
# ```zsh
|
2013-10-26 19:11:53 +02:00
|
|
|
# zle-line-init() {
|
2016-01-27 04:51:44 +01:00
|
|
|
# autosuggest_start
|
2013-10-26 19:11:53 +02:00
|
|
|
# }
|
|
|
|
# zle -N zle-line-init
|
2013-10-26 20:05:12 +02:00
|
|
|
# ```
|
2013-10-26 18:05:17 +02:00
|
|
|
|
2016-01-27 04:51:44 +01:00
|
|
|
unset _ZSH_AUTOSUGGESTION_ACTIVE
|
2013-11-08 12:20:57 +01:00
|
|
|
|
2016-01-27 04:51:44 +01:00
|
|
|
LIBDIR="${0:a:h}/lib"
|
2016-01-20 09:38:51 +01:00
|
|
|
|
2016-01-27 04:51:44 +01:00
|
|
|
source "$LIBDIR/config.zsh"
|
|
|
|
source "$LIBDIR/get_suggestion.zsh"
|
|
|
|
source "$LIBDIR/highlight.zsh"
|
|
|
|
source "$LIBDIR/widget/widgets.zsh"
|
|
|
|
source "$LIBDIR/widget/hook.zsh"
|
2016-01-20 09:38:51 +01:00
|
|
|
|
2016-01-27 04:51:44 +01:00
|
|
|
autosuggest_start() {
|
|
|
|
_ZSH_AUTOSUGGESTION_ACTIVE=true
|
2016-01-20 09:38:51 +01:00
|
|
|
|
2016-01-27 04:51:44 +01:00
|
|
|
# Register highlighter if needed to support zsh-syntax-highlighting plugin
|
|
|
|
if _zsh_autosuggest_syntax_highlighting_enabled; then
|
|
|
|
_zsh_autosuggest_register_highlighter
|
2013-10-26 19:11:53 +02:00
|
|
|
fi
|
2013-10-29 18:27:42 +01:00
|
|
|
|
2016-01-27 04:51:44 +01:00
|
|
|
_zsh_autosuggest_hook_widgets
|
2013-10-26 19:11:53 +02:00
|
|
|
}
|