Skip to content

Instantly share code, notes, and snippets.

@lingsamuel
Created March 26, 2020 06:10
Show Gist options
  • Save lingsamuel/092585507e323b30ddcfd917fa8e4c61 to your computer and use it in GitHub Desktop.
Save lingsamuel/092585507e323b30ddcfd917fa8e4c61 to your computer and use it in GitHub Desktop.
Oh-My-Zsh paste slow solution
# https://github.com/zsh-users/zsh-autosuggestions/issues/238#issuecomment-389324292
# This speeds up pasting w/ autosuggest
# https://github.com/zsh-users/zsh-autosuggestions/issues/238
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment