diff --git a/.zshrc b/.zshrc index 32f73ce..af5bef2 100644 --- a/.zshrc +++ b/.zshrc @@ -105,6 +105,18 @@ if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)" fi +# 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 + # Compilation flags # export ARCHFLAGS="-arch x86_64"