Last active
September 4, 2024 03:41
-
-
Save magicdude4eva/2d4748f8ef3e6bf7b1591964c201c1ab to your computer and use it in GitHub Desktop.
zsh-syntax-highlighting paste performance improvement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
... |
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.