I have recently recompiled vim, and ever since, when I have a big file, the scrolling gets slow. cursorline seems to be the problem; it doesn't matter if I use any of my plugins, if I have cursorline on, then the redrawing (and thus, the scrolling) gets slower, and the syntax highlight, while on its own inoffensive, when combined with cursorline makes the redrawing process very slow. Pretty much all of the solutions I have seen to this problem include either removing the syntax highlight or the cursorline; however, I was wondering if it would be possible to solve this some way. I have also already tried using set lazyredraw, set ttyfast, set foldmethod=manual and set synmaxcol=128, with no better results. Does anybody have more ideas?

  • I think you will not find anything more than what you already read: cursorline highlighting is one of the few things in vim which doesn't work that well. To workaround this problem I made a small plugin which puts a sign in the gutter where the current line is. It is still a work in progress but it seems to be working ok, you can have a look if you don't find a better solution. – statox Feb 13 '18 at 22:14
  • You can also have a look at this answer posted by Carpetsmoker, that's a good way to quickly locate your cursor. – statox Feb 13 '18 at 22:34
  • @statox Thank you for your answers, perhaps you can post them as an actual answer (instead of comments)? Great plugin, though I altered some things: I set g:GutterLineSign to instead of >, and added set updatetime=500 to my .vimrc. – dccsillag Feb 13 '18 at 23:19
  • 1
    Known problem – Christian Brabandt Feb 14 '18 at 7:22
  • What's "Columnline"? Is it a plugin? A typo? It's not mentioned anywhere in the question body. (Do you mean cursorcolumn?) – Rich Feb 14 '18 at 10:02

As @Christian Brabandt pointed out in the comment this is a known issue and there might not be a lot of solutions, for now, to make cursorline work properly.

However, you can use different workarounds:

  • In this answer @Carpetsmoker suggest a mapping which will set cursorline and cursorcolumn for a fraction of a second. This is pretty useful to easily locate your cursor.

  • I also created gutterline.vim which is a plugin which simply adds a sign in the gutter where your cursor is it was meant to be as simple as possible and the result is something like this:

gutterline screenshot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.