Forked from magicdude4eva/zsh-syntax-highlighting paste performance improvement
Created
May 28, 2020 09:58
-
-
Save abdul/59df6ed88f778836f786b5f8dbf6fff2 to your computer and use it in GitHub Desktop.
zsh-syntax-highlighting paste performance improvement
This file contains hidden or 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 | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment