Vim slow with ruby syntax highlighting

后端 未结 7 530
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-12 16:59

I\'ve been using vim over ssh to work for a week or two now and all has been going great. Today I decided to add in some syntax highlighting, autocomplete, and some other ge

相关标签:
7条回答
  • 2020-12-12 18:03

    Two things that will drastically help speed up Ruby syntax highlighting are disabling cursor line and relative number for Ruby (if you use those).

    I have the following in my .vimrc:

    " Ruby is an oddball in the family, use special spacing/rules
    if v:version >= 703
      " Note: Relative number is quite slow with Ruby, so is cursorline
      autocmd FileType ruby setlocal ts=2 sts=2 sw=2 norelativenumber nocursorline
    else
      autocmd FileType ruby setlocal ts=2 sts=2 sw=2
    endif
    
    0 讨论(0)
提交回复
热议问题