# Vim-ruby installation

**URL:** <https://www.ruby-forum.com/t/vim-ruby-installation/54089>\
**Category:** Ruby\
**Created:** [December 19, 2005, 8:03pm UTC](https://www.ruby-forum.com/t/vim-ruby-installation/54089 "2005-12-19T20:03:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 19, 2005, 8:03pm UTC](https://www.ruby-forum.com/t/vim-ruby-installation/54089/1 "2005-12-19T20:03:33Z")

</div>

I’ve read though a bunch of the vim-ruby posts in this group, and  
others, and still can’t get my vim-ruby installation functioning  
properly. Here is what I’ve done:

1. Installed the latest vim-ruby from RubyForge  
Did an “ruby gem vim-ruby”, ran the “vim-ruby-install.rb”.  
Now, I have the necessary ruby’esque files in my VIM installation  
directory… ie:

/usr/share/vim/vim63/syntax  
/usr/share/vim/vim63/ftplugin  
/usr/share/vim/vim63/ftdetect  
/usr/share/vim/vim63/compiler  
/usr/share/vim/vim63/indent

I also confirmed that /usr/share/vim/vim63/filetype.vim has the proper  
line that identifies ruby files by the given extensions (\*.rb, \*.gem,  
\*.ruby)

1. I then created a .vimrc file in my home directory, and added the  
following, as per the instructions on the vim-ruby page:

set nocompatible  
syntax on  
filetype on  
filetype indent on  
filetype plugin on

1. Now, it doesn’t work.  
When I vim a ruby file, it does have the proper colors, but when I hit  
“Tab”, it inserts an actual Tab instead of 2 spaces, and things like  
autocompleting “IF’s” doesn’t work by doing the Shift+Enter  
combination.  
So, the colors are correct… but nothing else !

Any help would be greatly appreciated !

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 19, 2005, 9:44pm UTC](https://www.ruby-forum.com/t/vim-ruby-installation/54089/2 "2005-12-19T21:44:24Z")

</div>

removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> /usr/share/vim/vim63/ftplugin  
> added the following, as per the instructions on the vim-ruby  
> page:
> 
> set nocompatible  
> syntax on  
> filetype on  
> filetype indent on  
> filetype plugin on
> 
> 1. Now, it doesn’t work.

> when I hit “Tab”, it inserts an actual Tab instead of  
> 2 spaces,

The vim-ruby set of vim configuration files do not change the  
tabstop/softtabstop/shiftwidth/et al options. As it says at  
[http://www.rubygarden.org/ruby?VimRubySupport](http://www.rubygarden.org/ruby?VimRubySupport), these are  
inappropriate for a system-wide plugin, since they reflect user  
preferences.

> and things like autocompleting “IF’s” doesn’t work  
> by doing the Shift+Enter combination.

I attempted the “if”-statement completion at at the URL above.  
If it still won’t work for you, you might have better luck at  
the vim-ruby ML at  
[http://rubyforge.org/pipermail/vim-ruby-devel/](http://rubyforge.org/pipermail/vim-ruby-devel/).

HTH,  
Tim H.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 19, 2005, 9:44pm UTC](https://www.ruby-forum.com/t/vim-ruby-installation/54089/3 "2005-12-19T21:44:30Z")

</div>

removed\_email\_address@domain.invalid wrote:

> When I vim a ruby file, it does have the proper colors,

It depends on what colors you like.

> but when I hit  
> “Tab”, it inserts an actual Tab instead of 2 spaces,

It seems to be a vim problem, but I don’have the vim NG in mind.  
Well, I do not do this everyday, you have to set expandtab  
:set expandtab  
:set shiftwidth=2  
I’m not sure of the syntax…  
This should be in vim configuration files probably in a ftplugin  
directory, this is very complicated but I think that the files  
like .vimre .vim in your home directory are taken in account before the  
others but I do not remember who overrides who.

But I’m sure it is something like that, in doubt hit the F1 key.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 19, 2005, 11:09pm UTC](https://www.ruby-forum.com/t/vim-ruby-installation/54089/4 "2005-12-19T23:09:50Z")

</div>

Tim and Harpo… thank you !

I didn’t realize that this vim-ruby package didn’t take care of these  
tihngs… even though I’d think that all Ruby users would want a 2  
space indent… no ?

Also, thanks for pointing out that mailing list… didn’t realize it  
existed. Thanks again !!
