3

I do my Rails dev from xterm and in vim.

I'm getting sick of running script/generate migration do_whatever, then trawling through db/migrate trying to tab-complete to 20091015235018_do_whatever when there's 5 other migrations with similar timestamps.

What's the best way to add a hook to open the generated migration in vim?

I'd rather not hack into Rails' core in /usr/lib as I work from several systems and can see myself wanting to create numerous such hooks. However, it doesn't really seem plugin worthy.

There are lots of simple ways to get the name of the generated file, but I'm not sure how to cleanly hook it into the generation. What do you think?

4

2 に答える 2

5

vimのより良いオプションは、rails.vimを使用してタイプ:Rmigration do<TAB> することです。タイムスタンプを無視します...

次のように入力して、移行を一度に作成および編集することもできます。:Rgenerate migration ...

于 2009-10-16T00:29:32.717 に答える