-
-
Save magicdude4eva/2d4748f8ef3e6bf7b1591964c201c1ab to your computer and use it in GitHub Desktop.
Add the following in .zshrc: | |
... | |
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl) | |
... | |
### Fix slowness of pastes with zsh-syntax-highlighting.zsh | |
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 | |
### Fix slowness of pastes | |
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh | |
... |
Thanks. It's worked for me.
I found that this worked as well: zstyle ':bracketed-paste-magic' active-widgets '.self-*'
. I found the solution here: zsh-users/zsh-syntax-highlighting#295 (comment).
@magicdude4eva Do you know if there are any major differences between your solution and the one provided in the issue in the link I provided?
I do not think so - I just tried a number of things until performance was alright. I have honestly not looked at this since 2019. Surprised that this is seemingly not fixed and requires still a workaround.
Worked perfectly for me - no more lags when pasting from the clipboard! 🎉
As someone new to zsh && oh-my-zsh, thanks !
Thanks worked
It's amazing! thank you so much for this, to paste now is so fast!
It's amazing! thank you so much for this, to paste now is so fast!
Thanks! it worked.
Are we required to source zsh-syntax-highlighting
?
Are we required to source
zsh-syntax-highlighting
?
I've disabled sourcing zsh-syntax-highlighting.zsh
and the fix still works.
Thanks, worked like charm @magicdude4eva when I visit your neighborhood, beer is on Me. Cheers
Thanks! works for me :)
it works for me, thanks
Please submit to the zsh-syntax-highlighting maintainer as well.
Worked for me too. Thanks! (Didn't need the source statement at the end though)