开发者

vim syntax highlight improve performance

H开发者_JS百科ow 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?


Try these settings:

set nocursorcolumn
set nocursorline
set norelativenumber
syntax sync minlines=256

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


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


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.


For large files vim will read the whole file in order to determine the context for accurate syntax highlighting.

Setting a maximum number of lines to scan will greatly increase performance, at the potential cost of accurate syntax highlighting.

Add the following to your .vimrc

autocmd BufEnter * :syn sync maxlines=500

This will set the maximum syntax buffer size to 500 lines.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜