Skip to content

Instantly share code, notes, and snippets.

@usagi
Created August 5, 2020 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usagi/20d755a57840a054fdf70ae7108e1350 to your computer and use it in GitHub Desktop.
Save usagi/20d755a57840a054fdf70ae7108e1350 to your computer and use it in GitHub Desktop.
autoload predict-on
alias predict.on="predict-on && export ZSH_PREDICT_STATE=0"
alias predict.off="predict-off && export ZSH_PREDICT_STATE=1"
predict.on
predict.toggle()
{
if [ $ZSH_PREDICT_STATE -eq 0 ]
then predict.off;
else predict.on;
fi;
}
zle -N predict.toggle
bindkey "^[[2~" predict.toggle
bindkey "^[[Z" predict.toggle
zstyle ':predict' verbose true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment