Mac OS X 10.6 (Snow Leopard) has VIM pre-installed (version 7.2), which is great.
It also has Ruby pre-installed (version 1.8.7) which is great too.
However, I want Ruby autocompletion in VIM. Looking up the VIM version (vim --version) shows -ruby (i.e. ruby support isn't enabled).
How to enable ruby for my VIM installation?
MacOS comes with a “system Ruby” pre-installed. If you see /usr/bin/ruby when you use the which command, it is the pre-installed macOS system Ruby. It's a bad idea to use the Mac system, Ruby, for developing Ruby applications (it's fine to use it for running utility scripts).
ruby-build is a plugin for rbenv that allows you to compile and install different versions of Ruby. ruby-build can also be used as a standalone program without rbenv. It is available for macOS, Linux, and other UNIX-like operating systems.
While it's possible to build and install your own Vim to replace the pre-installed version, I don't recommend it. It's far easier to just use MacVim instead:
http://code.google.com/p/macvim/
MacVim is a very Mac-friendly version of Vim, and it's got Ruby support already built in. It can be used as both a GUI and Terminal application. (Check out :help macvim-start
from within MacVim for details.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With