Vim response quite slow

后端 未结 5 2072
一向
一向 2021-02-06 01:03

If I open a file containing 5,000 lines of code and continue to input, I found that my vim became very slow, it displays my input after about 1s.

It even won\'t become

5条回答
  •  既然无缘
    2021-02-06 01:24

    The reason for slowness is often the not set or wrong set ruby_path on compile time of vim (see also discussion on google vim/ruby google group). It is easier to set it in vimrc, because you can change it without recompiling vim. You can set the path through the g:ruby_path variable in your .vimrc file. Don't copy and paste both, use the right one.

    If you setup RBENV you have to use this one:

    " ruby path if you are using rbenv
    let g:ruby_path = system('echo $HOME/.rbenv/shims')
    

    If you setup RVM you have to use this one:

    " ruby path if you are using RVM
    let g:ruby_path = system('rvm current')
    

    You can also use the vim-rbenv plugin, which sets the path too.

    For me the part on loading ruby specific functions in vim got 10 times faster.

    If you are using jruby, than the start up slowliness can be even bigger. See examples for fixing it here.

提交回复
热议问题