Monday, December 3, 2012

cursorline, cursorcolumn and syntax making vim slow with ruby files

I recently upgraded to fedora 17 and I noticed today that my cursor movement in vim was getting really slow, so started testing and soon discovered that disabling cursorcolumn and cursorline setting fixed the slowdown.
Now the weird part is that this worked fine before. This even works fine when ssh to a machine with a older 7.x version of vim (rhel5). So testing further also revealed that having cursorline/column on and syntax checking off worked also fine. Furthermore I found out that the slowdown only occurs when editing ruby files.
So as soon as I have one of the cursor options on along with syntax on, things really slow down. And my ruby script has only 300 lines. I Tested vim also on a large perl script (5000+ lines) and noticed only a really tiny slowdown (only because I was paying attention, in day to day operation I wouldn't have noticed). So don't know if anybody knows if this is a (recent) bug in the ruby syntax checking or has the ruby syntax checking become that heavy that things are slow? I understand that screen redraws slow things down, but if redraw was the issue here then the perl file would also suffer from the slowdown
Also have found some interesting things other people tried as a slowdown wordkaround here http://briancarper.net/blog/590/cursorcolumn--cursorline-slowdown and here https://gist.github.com/2624765