Stop Vim being slow when using rbenv

Note: I have now found a better solution to this problem, which I have documented. I suggest you use that solution over this one.

A lot of people, like me, use rbenv to manage Ruby versions on their machine. When I first set it up, I would see a large lag when opening a Ruby file in Vim. After a bit of Googling, I stumbled upon a solution.

Putting this into my .vimrc sped things up quite a bit:

let g:ruby_path = system('echo $HOME/.rbenv/shims')

If you’ve been struggling with Ruby slowness and are using rbenv, give that a go. If you use RVM, there’s a similar fix:

let g:ruby_path = system('rvm current')

comments powered by Disqus