tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

rails.vim

This is a massive (in a good way) Vim plugin for editing Ruby on Rails applications.

Installation

If you don't have a preferred installation method, I recommend installing pathogen.vim, and then simply copy and paste:

cd ~/.vim/bundle
git clone https://github.com/tpope/vim-rails.git
vim -u NONE -c "helptags vim-rails/doc" -c q

While not strictly necessary, bundler.vim and dispatch.vim are highly recommended.

FAQ

I installed the plugin and started Vim. Why does only the :Rails command exist?

This plugin cares about the current file, not the current working directory. Edit a file from a Rails application.

I opened a new tab. Why does only the :Rails command exist?

This plugin cares about the current file, not the current working directory. Edit a file from a Rails application. You can use :AT and the :T family of commands to open a new tab and edit a file at the same time.

Can I use rails.vim to edit Rails engines?

It's not supported, but if you touch config/environment.rb in the root of the engine, things should mostly work.

Can I use rails.vim to edit other Ruby projects?

I wrote rake.vim for exactly that purpose. It activates for any project with a Rakefile that's not a Rails application.

What Rails versions are supported?

All of them, although you may notice a few minor breakages if you dip below 3.0. A few features like syntax highlighting tend to reflect the latest version only.

Didn't rails.vim used to handle indent settings?

It got yanked after increasing contention over JavaScript. Check out sleuth.vim.

Self-Promotion

Like rails.vim? Follow the repository on GitHub and vote for it on vim.org. And if you're feeling especially charitable, follow tpope on Twitter and GitHub.

License

Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See :help license.