When I open a ruby based file (.rb,.erb) in nvim, it causes my whole laptop to slow down!

This seems to be caused by sheerun/vim-polyglot that I use for syntax highlighting, specifically the ruby module.

Any one have a better option or a way to fix this?

nvim config


1 Answer 1


It seems that if ruby path is not set correctly during vim compilation, it slows down vim when editing ruby files, check this post.

Also, using old regex engine (set re=1) rather than the new one speed things up apparently.

  • Whilst this didn't completly solve the issue, it did noticeably speed things up! Specifically I used: let g:ruby_path = system('echo $HOME/.rbenv/shims') to manually set the ruby path so I wouldn't have to re-compile neovim. I'll set this as the answer as this does explain the issue and provide a partial solution (maybe a complete one?).
    – Thermatix
    Commented Apr 11, 2018 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.