vim-rails is a powerful plugin by Tim Pope designed to enhance the development experience of Ruby on Rails applications inside Vim. It understands the Rails directory structure (app, config, db, lib, etc) and allows you to quickly jump between corresponding files (for example from a model to its test, or a view to its controller) via convenient mappings. It also augments Vim’s built-in file navigation (for example via gf) so that links in embedded Ruby templates or route definitions can open the correct destination. In addition to navigation, the plugin provides commands to generate scaffolding, migrate the database, switch environments, and so on, making many common Rails tasks accessible without leaving the editor. The plugin emphasizes staying within Vim and minimizing context-switching, which boosts productivity for Rails developers.
Features
- Enhanced gf (go-to-file) behaviour tuned for Rails file naming and conventions
- Commands to generate Rails scaffolding, migrate database, open console, etc
- Recognize routes, controllers, models and other Rails-specific constructs for quick navigation
- Works with embedded Ruby (ERB/Haml) to follow link definitions, partials, assets
- Minimal setup: once installed in a Rails project it “just works” with sensible defaults
- The plugin emphasizes staying within Vim and minimizing context-switching