1. Computing

Using rails.vim

By

Though it is possible to edit Rails applications in Vim without the help of any specialized scripts, the rails.vim script makes many tasks simpler. A good example is editing a controller file. Assuming your current directory is the application's base directory and you want to edit the Posts controller, a typical vim command might be :e app/controllers/posts_controller.rb. Though vim helps you out with tab completion, the rails.vim scripts makes it even easier. Simply run the command :Rcontroller posts.

The rails.vim script also gives easy access to scripts, generators and rake tasks. Some commands are very difficult to run in Vim, especially script/server. Since script/server never exits until you exit the server, running !script/server will never allow you to take control of Vim until you end the script. The rails.vim script gives you an :Rserver command that solves this problem.

  1. About.com
  2. Computing
  3. Ruby
  4. Ruby on Rails
  5. Editing Rails Applications in Vim

©2014 About.com. All rights reserved.