Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Ruby support for VIM on Mac OS X

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?

like image 850
JoHaan Avatar asked Jul 17 '10 19:07

JoHaan


People also ask

Does macOS have Ruby installed?

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).

What is Ruby on macOS X?

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.


1 Answers

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.)

like image 108
Bill Odom Avatar answered Sep 29 '22 00:09

Bill Odom