Skip to content

Commit

Permalink
Zsh: Make Paste Fast Again
Browse files Browse the repository at this point in the history
  • Loading branch information
dufferzafar committed Apr 15, 2019
1 parent a426b8e commit 3920f91
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions zsh/hacks.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,20 @@ zmodload -a colors
zmodload -a autocomplete
zmodload -a complist
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}

# ---------------------- MAKE PAINFULLY SLOW PASTE FAST ---------------------- #

# https://github.com/zsh-users/zsh-autosuggestions/issues/238#issuecomment-389324292

# This speeds up pasting with 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
}

pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish

0 comments on commit 3920f91

Please sign in to comment.