VIM with Ruby Rails?

I assume we have people on this board using VIM 7.0+ and Rails together.
I’ve been wondering what plug-ins, add-ons, scripts, etc. people are
using with VIM. In particular I’m interested in how people manage their
files (Textmate has that handy drawer and the concept of ‘projects’ to
it all organized). How can I do this type of thing with VIM? Or can I?

Also, it seems the Ruby/Rails intellisense/autocomplete in VIM 7 is a
bit flaky. I have to hit CTRL-X, CTRL-O in order to prompt it, then I
cannot type the letters of the method I’m looking it just goes beserk.
What is the correct way to use this?

Lewis Grann

  • VIM n00b

(I own Textmate, but my remote servers are Linux based and I have to
occasionally edit files remotely and VIM is that way I plan to do this.)

Lewis Grann wrote:

I assume we have people on this board using VIM 7.0+ and Rails together.
I’ve been wondering what plug-ins, add-ons, scripts, etc. people are
using with VIM. In particular I’m interested in how people manage their
files (Textmate has that handy drawer and the concept of ‘projects’ to
it all organized). How can I do this type of thing with VIM? Or can I?

Also, it seems the Ruby/Rails intellisense/autocomplete in VIM 7 is a
bit flaky. I have to hit CTRL-X, CTRL-O in order to prompt it, then I
cannot type the letters of the method I’m looking it just goes beserk.
What is the correct way to use this?

Lewis Grann

  • VIM n00b

(I own Textmate, but my remote servers are Linux based and I have to
occasionally edit files remotely and VIM is that way I plan to do this.)

The only thing I’ve done is create a single mapping to turn F2 and F3
into next buffer and previous buffer. Then I simple load all the files
that I will be working with and switch between them as needed. I use
the ‘sh’ command to drop to the shell to run tests then ‘exit’ back into
vim, with everything just like I left it. I don’t really miss having
the project view to much.

I did recently see some one mention writing a script to launch vim, one
that would load all the appropriate models/views/controllers for each
argument passed it. Meaining, for example, if you did ‘ed users’ it
would launch vim with “app/controllers/users_controller.rb”,
“app/models/user.rb”, and everthing in “app/views/users/*”. Of course
this would work for any editor and can be customized how ever you want.

I’ve never been a real fan of intellisense/autocomplete and have it
turned off so I can’t really say much about that.

On 5 Jan 2007, at 22:11, Lewis Grann wrote:

I assume we have people on this board using VIM 7.0+ and Rails
together.
I’ve been wondering what plug-ins, add-ons, scripts, etc. people are
using with VIM.

Tim Pope’s rails.vim plugin is excellent:

http://www.vim.org/scripts/script.php?script_id=1567

The Vim-Rails wiki page is quite helpful too:

http://wiki.rubyonrails.org/rails/pages/HowtoUseVimWithRails

In particular I’m interested in how people manage their
files (Textmate has that handy drawer and the concept of ‘projects’ to
it all organized). How can I do this type of thing with VIM? Or
can I?

There are various plugins which do this – just search for “Vim file
explorer”. My favourite is the Buffer Explorer, although it doesn’t
sound like quite what you are after:

http://www.vim.org/scripts/script.php?script_id=42

Also, it seems the Ruby/Rails intellisense/autocomplete in VIM 7 is a
bit flaky. I have to hit CTRL-X, CTRL-O in order to prompt it, then I
cannot type the letters of the method I’m looking it just goes beserk.
What is the correct way to use this?

Try Ctrl-n. I find I have to use the cursor keys (yuk) to reach the
match I want.

Regards,
Andy S.