auto-fu.zsh
auto-fu.zsh copied to clipboard
bindkey to disable auto-fu?
Hello,
I am trying to figure out how to switch between "predict-on"/"predict-off" and auto-fu.
This is my predict-on setting.
autoload predict-on zle -N predict-off zle -N predict-on bindkey '^Z' predict-on
bindkey '^X^Z' predict-off
bindkey '^X' predict-off zstyle ':predict' verbose true
I noticed that I cannot have both predict-on and auto-fu active at the same time. What do I do to turn-off auto-fu?
Is it possible to have bindkeys as the predict-on does to turn on/off auto-fu?
I tried zle -N auto-fu-off and zle-N auto-fu-deactivate. But, both did not seem to do anything.
Any thoughts, please?
Thanks Joe
Hi, Joe! Ugh, predict-on
... Good catch!
To turn-off auto-fu (and then predict-on) is a little tricky, but I can accomplish it like this:
# predict-on setting
autoload -Uz predict-on
zle -N predict-on
bindkey '^Z' predict-on
auto-fu-exit-predict-on () {
zle -U $'\C-Z' # assume $'\C-Z' is predict-on key
zle send-break
}
zle -N auto-fu-exit-predict-on
# -M afu is special; keymap for auto-fu is in effect
bindkey -M afu '^Z' auto-fu-exit-predict-on
# forcibly turn-on auto-fu
auto-fu-force-on () { zle zle-line-init }
zle -N auto-fu-force-on
I hope this helps.