Skip to content

Instantly share code, notes, and snippets.

@jwieringa
Created November 8, 2011 16:40
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jwieringa/1348303 to your computer and use it in GitHub Desktop.
Save jwieringa/1348303 to your computer and use it in GitHub Desktop.
Install Vim with Ruby Interpreter and Command-T on Ubuntu

Summary

The following instructions will install Vim with the Ruby interpreter and Command-T. I keep my vim settings under revision control, thus I have chosen to use Git's submodules and Pathogen to manage Command-T. Depending on your preferences, you may want to setup Command-T differently. I recommend reading through the Command-T Readme

Install dependencies (what my system required), hg, and rake

sudo apt-get install ruby ruby-dev libncurses5-dev mercurial clone build-essential rake

I chose to compile vim with my system Ruby, 1.8.7. It is important that you use the same version to compile both Vim and Command-T. If your using RVM and you want to do the same, before proceeding you will want to:

rvm use system

Download and build Vim with Ruby

There are several configure options for Vim. Below, you can see what I have chosen. You can see all of the options with:

./configure --help

Once you have chosen your options:

hg clone https://vim.googlecode.com/hg/ vim
cd vim
./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --prefix=$HOME
make
sudo make install

Check for successful installation "+ruby"

vim --version | grep ruby
-python3 +quickfix +reltime -rightleft +ruby +scrollbind +signs +smartindent 

Command-T installation via git submodule and pathogen

cd ~/.vim    " If vim directory under git, you will want to be at the git root
git submodule add git://git.wincent.com/command-t.git bundle/command-t
git submodule init

Compile Command-T

cd ~/.vim/bundle/command-t
rake make

Generate helptags

:call pathogen#helptags()
@isomorphisms
Copy link

$ vim -- version | grep ruby
Vim: Warning: Output is not to a terminal
Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.
Error detected while processing /home/chris/.vim/plugin/vimdir.vim:
line 2:
E121: Undefined variable: luser
E15: Invalid expression: $VIMHOME . "/vimrc.". luser

@jwieringa
Copy link
Author

Hi isomorphisms,

I believe there is an extra space in the command that is causing the error. Take a look at the space here:

$ vim -- version | grep ruby
        ^

Thanks for reading!

@isomorphisms
Copy link

Oops! Stupid mistake. Thanks.

@jwieringa
Copy link
Author

No problem, let me know if you have any questions or comments about the tutorial. It might need some updating. :)

@Nosfheratu
Copy link

after check the installation works fine (vim --version | grep ruby) y cant find the ~/.vim git folder... where is it?

@vjsingh
Copy link

vjsingh commented Nov 6, 2013

This is awesome, worked perfectly. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment