Vim scrolls very slowly when a line is too long

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.


Solution 1:

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.

Solution 2:

try following:

" Syntax coloring lines that are too long just slows down the world
set synmaxcol=128

else i recommend speeding up vim by:

set ttyfast " u got a fast terminal
set ttyscroll=3
set lazyredraw " to avoid scrolling problems

Solution 3:

I think you seem to have cursorline set. I found that used to be the biggest contributor to lag in my vim. You might want to try disabling that.