tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.09k stars 381 forks source link

The plugin does not support syntax highlighting/indentation for turbo stream ERB files #587

Closed kulbirsaini closed 2 years ago

kulbirsaini commented 2 years ago

Vim: 8.1.2269 Vim Rails: 9c92dafe6894aed3fa81df7ac52cdd8e7a8ea9a6 [May 05, 2022] Ruby: 3.1.2 Rails: 7.0.2

I had to add the following code to my .vimrc to make the Rails syntax highlighting and indentation work for turbo stream files with .turbo_stream.erb extension.

" Set filetypes
augroup filetypedetect
    au BufRead,BufNewFile *.turbo_stream.erb set filetype=eruby.html
augroup END

I guess this can be added to the base plugin itself.