# Looking for good Ruby and Rails configuration for vim

**URL:** <https://www.ruby-forum.com/t/looking-for-good-ruby-and-rails-configuration-for-vim/130393>\
**Category:** Ruby\
**Created:** [February 27, 2008, 10:45pm UTC](https://www.ruby-forum.com/t/looking-for-good-ruby-and-rails-configuration-for-vim/130393 "2008-02-27T22:45:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [February 27, 2008, 10:45pm UTC](https://www.ruby-forum.com/t/looking-for-good-ruby-and-rails-configuration-for-vim/130393/1 "2008-02-27T22:45:51Z")

</div>

I am afraid I really like vi, but I would like some syntax highlighting,  
indentation, and block skeleton stuff like Dave and David recommend on  
page 27 of their agile book. I wonder if I make a wish here whether  
some wonderful guru might post the vim configuration from heaven for  
Rails and Ruby???

Sincerely, Xeno

---

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [February 27, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/looking-for-good-ruby-and-rails-configuration-for-vim/130393/2 "2008-02-27T23:01:14Z")

</div>

On Wed, Feb 27, 2008 at 1:44 PM, Xeno C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I am afraid I really like vi, but I would like some syntax highlighting,  
> indentation, and block skeleton stuff like Dave and David recommend on  
> page 27 of their agile book. I wonder if I make a wish here whether  
> some wonderful guru might post the vim configuration from heaven for  
> Rails and Ruby???

first, get the vim-ruby gem:

gem install vim-ruby

then go through the following guide and see what else seems useful:

[http://wiki.rubyonrails.org/rails/pages/HowtoUseVimWithRails](http://wiki.rubyonrails.org/rails/pages/HowtoUseVimWithRails)

martin

---

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [February 28, 2008, 1:03pm UTC](https://www.ruby-forum.com/t/looking-for-good-ruby-and-rails-configuration-for-vim/130393/3 "2008-02-28T13:03:26Z")

</div>

I have these set in my local .vimrc:

set sw=2  
set smartindent  
set smarttab

It sets two space ‘virtual’ tabs (so when you hit tab, it inserts two  
spaces, and when you hit backspace on whitespace at the beginning of the  
line, it takes two spaces - series of 8 are converted to real tabs). In  
my  
global vimrc, these are set:

syntax on  
set showcmd  
set showmatch  
set smartcase  
set incsearch  
set mouse=a

This enables syntax highlighting, shows commands as you type them in the  
status bar, highlights matched text as you enter it while searching  
(with  
`/'), sets the case matching to`smart’ (no idea about the semantics,  
try  
:help smartcase), sets searches to start from where your cursor is, and  
enables mouse usage in consoles that allow it.

Cheers,  
Arlen.

---

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [March 1, 2008, 1:26am UTC](https://www.ruby-forum.com/t/looking-for-good-ruby-and-rails-configuration-for-vim/130393/4 "2008-03-01T01:26:32Z")

</div>

Martin DeMello wrote:

> On Wed, Feb 27, 2008 at 1:44 PM, Xeno C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I am afraid I really like vi, but I would like some syntax highlighting,  
> > indentation, and block skeleton stuff like Dave and David recommend on  
> > page 27 of their agile book. I wonder if I make a wish here whether  
> > some wonderful guru might post the vim configuration from heaven for  
> > Rails and Ruby???

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [March 1, 2008, 1:27am UTC](https://www.ruby-forum.com/t/looking-for-good-ruby-and-rails-configuration-for-vim/130393/5 "2008-03-01T01:27:43Z")

</div>

Arlen C. wrote:

> :help smartcase), sets searches to start from where your cursor is, and  
> enables mouse usage in consoles that allow it.
> 
> Cheers,  
> Arlen.

Thank you also Arlen.
