Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save magicdude4eva/2d4748f8ef3e6bf7b1591964c201c1ab to your computer and use it in GitHub Desktop.

Select an option

Save magicdude4eva/2d4748f8ef3e6bf7b1591964c201c1ab to your computer and use it in GitHub Desktop.

Revisions

  1. magicdude4eva revised this gist Aug 14, 2022. No changes.
  2. magicdude4eva revised this gist Feb 21, 2019. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion zsh-syntax-highlighting paste performance improvement
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,9 @@
    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]}
    @@ -11,5 +17,5 @@ zstyle :bracketed-paste-magic paste-init pasteinit
    zstyle :bracketed-paste-magic paste-finish pastefinish
    ### Fix slowness of pastes

    source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
    source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
    ...
  3. magicdude4eva revised this gist Feb 21, 2019. No changes.
  4. magicdude4eva created this gist Feb 21, 2019.
    15 changes: 15 additions & 0 deletions zsh-syntax-highlighting paste performance improvement
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    ### 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-autosuggestions/zsh-autosuggestions.zsh
    source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh