Skip to content

Commit

Permalink
speed up pasting with zsh-autosuggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
dakshshah96 committed Sep 17, 2020
1 parent 8511f8a commit 417763f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 417763f

Please sign in to comment.