vim-rails icon indicating copy to clipboard operation
vim-rails copied to clipboard

*.turbo_stream.erb file support

Open thewatts opened this issue 1 year ago • 2 comments
trafficstars

Hi There!

Just started leveraging this plugin, and it's amazing (👏). Thank you for all your hard work on this!

Something I noticed, is that with the new Rails view format for turbostreams, ex: new.turbo_stream.erb, vim is setting the filetype to eruby.html, instead of eruby.

As such - my linter is throwing errors.

Here's an example below - top with vim-rails enabled, bottom with it disabled:

CleanShot 2023-12-09 at 12 58 09@2x

Note: This doesn't happen with the typical new.html.erb type files - it is only happening with turbo_stream files.

Any help here would be greatly appreciated.

Thank you!

thewatts avatar Dec 09 '23 19:12 thewatts

It looks like something was added already here: https://github.com/tpope/vim-rails/commit/855ff28e6c0aacc5e1fdfbf965283bd80cb0d89d

However, I don't know the difference between eruby and eruby.html filetypes.

@kulbirsaini - I see that you added the initial issue, here: https://github.com/tpope/vim-rails/issues/587 -

Is eruby.html some sort of filetype that you have configured through a plugin that isn't the typical eruby?

thewatts avatar Dec 09 '23 19:12 thewatts

@thewatts sorry, just seeing this. eruby.html is added by this plugin itself at https://github.com/tpope/vim-rails/blob/master/plugin/rails.vim#L117-L118 . I have not added any custom filetype to my .vimrc.

Edit: Just realized that line comes from my suggestion. Only other ruby/rails plugin I use is https://github.com/vim-ruby/vim-ruby. So, I guess it has something to do with that plugin.

kulbirsaini avatar Dec 29 '23 16:12 kulbirsaini