David Oneill
David Oneill

Reputation: 13095

Use closetag.vim script in .html.eb files

In https://stackoverflow.com/a/130741/168646 I learned about closetag.vim, which is exactly what I was hoping to find. However, I can't seem to get it working for the .html.erb files in my rails project.

I tried adding erb and html.erb to the list of file types that source the script (in my .vimrc file):

autocmd Filetype html,xml,erb,html.erb source ~/.vim/scripts/closetag.vim

What am I missing?

Upvotes: 3

Views: 424

Answers (1)

Michael Berkowski
Michael Berkowski

Reputation: 270687

The file type of .erb files is eruby. Add it to your autocmd:

autocmd Filetype html,xml,eruby source ~/.vim/scripts/closetag.vim

To determine what filetype Vim is using for a file, you can do:

set filetype?
" Shows:
" filetype=eruby

Upvotes: 4

Related Questions