https://networm.me/2020/02/09/zsh-slow/
iTerm使用autosuggestions
插件后,在终端中粘贴CURL内容的时候很慢,基本上是一个字符一个字符输入的,像打字机一样,真的受不了(感官上无法接收),太影响效率了。
解决方案
在.zshrc文件中配置以下内容:
# 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
在终端输入source .zshrc
重新使配置生效,或者重新打开终端,再尝试下,如丝般顺滑。
参考: