Is there currently a plugin that you ruby on rails developers that are also using macvim/gvim/vim that allows you to take a quick block of code and create a partial from it? I know that TextMate does this, figured someone has ported it by now to vim also.
views:
50answers:
2
+1
A:
rails.vim can do this. From the features summary:
:Rextract
file replaces the desired range (ideally selected in visual line mode) withrender :partial => 'file'
, which is automatically created with your content. The@file
instance variable is replaced with the file local variable.
mikej
2010-07-17 20:18:55
+3
A:
You want Tim Pope's rails.vim plugin:
It provides an :Rextract
command that pulls a range of lines into a partial. Here's a very short demo of it in action:
http://rails.vim.tpope.net/images/rpartial.gif
(The :Rpartial
command in the demo is an alias for :Rextract
.)
The plugin provides dozens of other features, too, and many people consider it a must-have for Rails development in Vim.
Bill Odom
2010-07-17 20:23:40