rails.vim
Accept no imitations: rails.vim is the one true Vim plugin for syntax highlighing, easy navigation, and script invocation for all your Ruby on Rails applications, transparently and unobtrusively.
What people are saying
to anyone that uses vim: rails.vim kicks ASS!
—motionI was sold with just :RSuni<tab><enter>
—bitsweatlove your plugin. already forgot about textmate
—victorirails.vim makes things like "gf" work. for that alone its awesome :)
—vendullGrab the rails.vim plugin and there's not much you can't do with that sucker. 8)
—rizzit's great... I want to have tpope's babies
—ReinHyep. I want to have tpope's babies
—mando
Features
- Automatically detects buffers containing files from Rails applications, and applies settings to those buffers (and only those buffers). You can use an autocommand to apply your own custom settings as well.
- Unintrusive. Only files in a Rails application should be affected; regular Ruby scripts are left untouched. Even when enabled, the plugin should keep out of your way if you're not using its features.
- Provides reasonable settings for working with Rails applications. Rake is the makeprg (and it always knows where your Rakefile is), shiftwidth is 2, and path includes an appropriate collection of directories from your application.
- Easy navigation of the Rails directory structure. gf considers context and knows about partials, fixtures, and much more. There are two commands, :A (alternate) and :R (related) for easy jumping between files, including favorites like model to migration, template to helper, and controller to functional test. For more advanced usage, :Rmodel, :Rview, :Rcontroller, and several other commands are provided.
-
Enhanced syntax highlighting. From
has_and_belongs_to_manytodistance_of_time_in_words, it's here. For Vim 7 users, completefunc is set to enable syntax based completion on CTRL-X CTRL-U, making it easy to complete such long method names. - Interface to script/*. Generally, use :Rscript about to call script/about. Most commands have wrappers with additional features: :Rgenerate controller Blog generates a blog controller and edits app/controllers/blog_controller.rb.
-
Partial extraction and migration inversion. :Rextract
file replaces the desired range (ideally
selected in visual line mode) with
render :partial => 'file', which is automatically created with your content. The@fileinstance variable is replaced with thefilelocal variable. :Rinvert takes aself.upmigration and writes aself.down. -
Integration with other plugins. :Rproject creates a new
project.vim
project. :Rdbext loads database settings from
database.ymlfor dbext.vim (and this happens by default under most circumstances). Cream users get some additional mappings, and all GUI users get a menu.
Download
- Rails
- Any version of Ruby on Rails is acceptable but the latest is always recommended. See the download page for details.
- Vim
- For maximum functionality, you are advised to install Vim 7 or later. However, rails.vim is compatible with Vim 6.x as well, so you don't have to upgrade that Debian Sarge box just yet.
- rails.vim
- The official source of rails.vim is the vim.org script repository. If this is unaccessable, try this mirror. For the very latest features and bugs, a development version can be retrieved via
SubversionGit:git clone git://git.tpope.net/git/vim-rails.git
Demonstrations
Contact
The rails.vim author can be emailed at vim at tpope. info. He can also be found on freenode, frequenting #vim and #rubyonrails.