https://networm.me/2020/02/09/zsh-slow/

iTerm使用autosuggestions 插件后,在终端中粘贴CURL内容的时候很慢,基本上是一个字符一个字符输入的,像打字机一样,真的受不了(感官上无法接收),太影响效率了。

解决方案

在.zshrc文件中配置以下内容:

  1. # This speeds up pasting w/ autosuggest
  2. # https://github.com/zsh-users/zsh-autosuggestions/issues/238
  3. pasteinit() {
  4. OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
  5. zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
  6. }
  7. pastefinish() {
  8. zle -N self-insert $OLD_SELF_INSERT
  9. }
  10. zstyle :bracketed-paste-magic paste-init pasteinit
  11. zstyle :bracketed-paste-magic paste-finish pastefinish

在终端输入source .zshrc重新使配置生效,或者重新打开终端,再尝试下,如丝般顺滑。

参考: