iTerm使用autosuggestions 插件后,在終端中粘貼CURL內(nèi)容的時候很慢,基本上是一個字符一個字符輸入的,想打字機一樣,真的受不了,太影響效率了。
解決方案
在.zshrc文件中配置以下內(nèi)容:
# 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重新使配置生效,或者重新打開終端,再嘗試下,如絲般順滑。