Drastic proposal: rename eruby to rhtml to make way for an HTML free eruby filetype

Doug Kearns dougkearns at gmail.com
Sat Mar 10 00:58:39 EST 2007


On Fri, Mar 09, 2007 at 01:49:06PM -0600, Tim Pope wrote:
> On Fri, Mar 09, 2007 at 04:39:20PM +0000, Hugh Sasse wrote:

<snip>
 
> The extension isn't the limiting factor, the filetype is.  Having erb
> for plain text and eruby for HTML is confusing.  However, it might be
> a good idea to use erb rather than eruby for the new file type, so
> that we end up with erb and rhtml.

Isn't erb, along with eruby and possibly others, just an
_implementation_ of eRuby?
 
> > Drat! :-)  I've answered the wrong question.  Hope soemthing in here
> > is of use...  In principle I'm in favour of encouraging this use of
> > eruby, mainly because I keep forgetting about it, and doing code generation
> > the hard way.  Hence all that sfuff in my vimrc.
> 
> If you want to use ERB with C, attached is a proof of concept for you
> to try.  Drop it in ~/.vim/syntax/erb.vim.  Edit somefile.c.erb and
> and :set ft=erb.  This syntax file looks at the filename to determine
> what to embed.  So foo.c.erb will embed in C, foo.html.erb will embed
> in HTML, and foo.sql.erb will embed in SQL.  In fact, this script
> could be renamed to eruby.vim and it would more or less be a drop-in
> replacement, rendering my original suggestion moot.

This is what I had in mind but it's more difficult to get this right
with the ftplugins.

> But all the magic
> going on in the background is probably a bad idea.  If we get rid of
> the magic, having a file like this would still make using ERB with
> other file types a lot easier.

I like magic. :-)

<snip>
 
Regards,
Doug


More information about the vim-ruby-devel mailing list