0

When I paste in large blocks of text, or even just long commands or urls, pasting is done character by character and takes a long time. I can make it speed up by pressing right arrow but that sometimes autosuggest will then come in and paste other things.

I know this is caused in part by paste bracketing. I tried turning it off which makes it about the speed it goes when I press right arrow during a slow paste. But then indents aren't preserved and it executes line by line. This doesn't work for me since I regularly paste in multiline commands like with Docker for example. Also, syntax highlighting doesn't work anymore when using the right arrow technique.

Is there a way to make pasting instant but preserve the bracketing behavior? In vim it's instant but I guess indents are just newline characters or something I guess? Is bracketing even causing this problem or is there some other explanation/fix?

I'm using iTerm2 with ohmyzsh and Powerlevel10k on MacOS Catalina. Searched high and low but only found posts about the ~0 and ~1 characters being inserted with bracketing or something. I never had that happen.

A gif for illustration purposes:

https://i.imgur.com/vFL0gmL.mp4

Elias Khan
  • 85
  • 10
  • As romkatv answered on Reddit, you have to set `DISABLE_MAGIC_FUNCTIONS="true"` at the top of you .zshrc. Works like a charm! – Elias Khan Nov 03 '20 at 17:29

1 Answers1

1

Just disable magic functions in .zsh.

Uncoment DISABLE_MAGIC_FUNCTIONS="true"

4b0
  • 21,981
  • 30
  • 95
  • 142
nico
  • 11
  • 1
  • Curious to know if this just disables paste bracketing or will it disable other functionality too. I searched for "zsh magic functions" but wasn't able to find much. – rangfu Mar 11 '23 at 12:20