Mac – Vim scrolls very slowly when a line is too long

macvimvim

I would never have thought that Vim would be so slow. All I have is the following long line:

enter image description here
(Click image to enlarge)

I run Vim (MacVim) under Mac OS X with the terminal app. Here is my vimrc. I hope that it has nothing to do with some of my plugins. If I break up the big line in the image, everything is working fast again.

Best Answer

This is a known problem with Vim and very long lines. I see three solutions:

  1. Turn off syntax highlighting with :syntax off.
  2. Limit syntax highlighting with :set synmaxcol=200 or some other value.
  3. Break down your long line in smaller chunks with :s/\s<a/<C-v><Enter><a.

In this particular case I'd recommend solution 3.

Related Question