Syntax highlighting causes terrible lag in Vim

前端 未结 10 1517
孤独总比滥情好
孤独总比滥情好 2020-12-12 11:20

I love Vim. But its giving me hard times right now.

I use a lot of plugins and during the last 6 months, I\'ve found a lot of awesome ones. But my Vim got really slu

相关标签:
10条回答
  • 2020-12-12 12:08

    I found that "set foldmethod=syntax" makes 7.4 almost unusable slow e.g. for js&ruby files (ubuntu 13.10) whereas "set foldmethod=indent" works fine.

    0 讨论(0)
  • 2020-12-12 12:09

    I'm pretty sure that

    set t_Co=256
    set background=dark
    colorscheme candyman
    

    have nothing to do with that lag. The two first lines are useless (the number of usable colors is defined according to your $TERM and your colorscheme already does set background=dark) but not really harmful.

    Common "Vim is slowing to a crawl" causes include poorly written autocmds, too many autocmds, reloading one's ~/.vimrc too often, poorly written plugins…

    Please post your setup so that we can help you find out why you experience that lag.

    0 讨论(0)
  • 2020-12-12 12:13

    From another stack overflow question, I get vim fast by adding the following line in .vimrc file:
    set re=1
    This will force vim to use a older version of regex engine and it is actually FASTER for ruby.

    0 讨论(0)
  • 2020-12-12 12:16

    I have had this problem for a long time, and it was driving me crazy. I tried installing vim-ruby. Not sure if that helped but at least now I have the most up-to-date version of ruby syntax highlighting (with any performance improvements since the last version of Vim was released).

    But then I looked further, and discovered that vim-ruby has a mode that skips all the expensive highlighting. Try adding this line to your vimrc and see if it helps (it did for me, finally!):

    let ruby_no_expensive=1

    0 讨论(0)
提交回复
热议问题