Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing vim with ruby support (+ruby)

Tags:

vim

ruby

I'm trying to get command-t installed for vim but my current version of vim doesn't have the (+ruby) flag. The command "which ruby" shows that ruby is installed.

What do I need to do in order to activate the +ruby flag in vim?

Also, what does the +ruby flag technically mean?

like image 819
Chris Greer Avatar asked Sep 25 '10 18:09

Chris Greer


People also ask

Does vim support Ruby?

VimScript provides the ruby command that can be used to execute some Ruby code. Instead of using another VimScript function we can instead refer to it as a Ruby function or executed Ruby code. For a single line of Ruby code we can use the ruby command followed by your Ruby code.

How do I install latest version of Vim?

Compiling Vim Using Sources CodeDownload the latest Vim source code from Github repository. Configure the source code according to your system environment. Compile and install Vim from Source code on your Linux system. Finally, Open Vim text editor on your system.


2 Answers

Some package provides vim-ruby on Ubuntu, for example vim-nox.

simply:

sudo apt-get install vim-nox; 

will get you vim with ruby, as well as compiled in "support for scripting with Perl, Python, Ruby, and TCL but no GUI."

sudo apt-get install vim-rails 

will install a "selection of vimscripts that make editing Ruby on Rails applications extremely easy." but as it depends on vim-full and vim-addon-manager, it will also install the vim-gnome version of the GUI, that is "a version of vim compiled with a GNOME2 GUI and support for scripting with Perl, Python, Ruby, and TCL."

like image 107
DenMark Avatar answered Oct 02 '22 10:10

DenMark


I think "Compiling Vim With Ruby Integration On Snow Leopard" might actually help. I'm on exactly same boat at the moment.


Ok... got it to work. Took me like half hour or so.

This should help (I got Ubuntu):

sudo apt-get install mercurial hg clone https://vim.googlecode.com/hg/ vim cd vim ./configure --enable-rubyinterp make sudo make install 

To test if things look fancy:

vim --version | grep ruby 

Should return something like:

-python3 +quickfix +reltime -rightleft +ruby +scrollbind +signs +smartindent 

Ruby should have plus now. Another trick to test it - enter vim and hit :ruby 1. Should not fail.

like image 21
Arnis Lapsa Avatar answered Oct 02 '22 08:10

Arnis Lapsa