Upgrade to Pro — share decks privately, control downloads, hide ads and more …

VIm-rails

 VIm-rails

A lightening talk on the best aspects of Tim Pope's Vim-rails plugin.

Avatar for paul.haddad

paul.haddad

March 13, 2016

Other Decks in Technology

Transcript

  1. The gf Command Post.first Post Model has_many :comments Comment Model

    link_to 'Home', :controller => 'blog’ Blogs Controller <%= link_to "New", new_comment_path %> Comments Controller#new <%= render 'shared/sidebar' %> Sidebar Partial Go back to previous file: Ctrl-^
  2. Alternate-Related Files Alternate Command: Go to alternate file, normally the

    test file. :A :AE :AS :AV :AT :AD Related Command: Go to the related file, which varies depending on the file you’re in. :R :RE :RS :RV :RT :RD E -edit S - split V - vertical split T - tab D - buffer
  3. More fine-grained navigation There are sensible defaults if you don’t

    specify an argument. :Econtroller — Jump to the controller related to the file you’re in. :Econtroller controller_name — Jump to the specified controller. Navigation becomes powerful when you combine them with E, S, V and T: :Eenvironment :Efixtures :Ehelper :Einitializer :Sjavascript :Slayout :Silb :Slocale :Vmailer :Vmigration :Vmodel :Vschema :Tspec :Tstylesheet :Tunittest :Tview
  4. Running Tests To run the tests for a file: :Rake

    — Run all the tests in the current file. :.Rake — Focused run of just the method, example, or scenario on the current line.
  5. Migrations :Rgenerate migration add_something_to_tablename — Generate a migration. :Rinvert —

    In a migration file, attempt to rewrite the up method into a down method.
  6. Server :Rserver — Run the server process from Vim. :Rserver!

    — Restart the server. :Rserver!- — Stop the running server.