Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim syntax highlight improve performance

How do I improve performance when I'm scrolling my files and coding them? With syntax highlighting, vim is so slow. When I switch it off, everything is ok. Is there a way or any recommendations to make it faster?

like image 497
RusAlex Avatar asked Jan 23 '11 18:01

RusAlex


3 Answers

Try these settings:

set nocursorcolumn
set nocursorline
set norelativenumber
syntax sync minlines=256

Also check http://vim.wikia.com/wiki/Fix_syntax_highlighting

like image 161
Gonzalo Serrano Avatar answered Oct 17 '22 00:10

Gonzalo Serrano


I was having an issue with slow performance from vim when editing certain CSS files.

I discovered that the cause in my case was large inline images using data urls.

To speed things up, I just modified my .vimrc like so:

set synmaxcol=200  

This did the trick for me. Hope it helps someone else. Hat tip to https://superuser.com/questions/302186/vim-scrolls-very-slow-when-a-line-is-to-long

like image 25
knowuh Avatar answered Oct 17 '22 00:10

knowuh


You can use the scrolljumpoption. The scrolling won't be smoother but rather than scrolling line by line, it will scroll of scrolljump lines at once.

You can try :
set scrolljump=5

It does not solve your root issue, but it is a workaround.

like image 2
Xavier T. Avatar answered Oct 17 '22 00:10

Xavier T.