From 5e2d10cc8b680b38b2c5022bf38f80d92d0687b7 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sun, 22 Feb 2015 09:46:38 -0600 Subject: [PATCH] Add Generate and Edit Rails Migration to vim til. --- README.md | 1 + vim/generate-and-edit-rails-migration.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 vim/generate-and-edit-rails-migration.md diff --git a/README.md b/README.md index a7c56eb..9ce73e2 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ I shamelessly stole this idea from ## vim +- [Generate and Edit Rails Migration](vim/generate-and-edit-rails-migration.md) - [Head of File Name](vim/head-of-file-name.md) - [Preview Buffer](vim/previous-buffer.md) - [Quick File Info](quick-file-info.md) diff --git a/vim/generate-and-edit-rails-migration.md b/vim/generate-and-edit-rails-migration.md new file mode 100644 index 0000000..3c009cc --- /dev/null +++ b/vim/generate-and-edit-rails-migration.md @@ -0,0 +1,15 @@ +# Generate and Edit Rails Migration + +Creating a new Rails migration has always involved two distinct steps for +me. The first is to run `rails g migration CreateSomeTable` to create a +migration file. The second is to copy and paste the migration's filename +after `vi` to actually start editing it. + +[Rails.vim](https://github.com/tpope/vim-rails) collapses these steps into +one: + +``` +:Rgenerate migration CreateSomeTable +``` + +[source](http://stackoverflow.com/questions/7857177/with-vim-rails-can-you-create-a-new-migration-file-and-open-it-in-one-go)