evidens/vim-twig

HTML is not highlighted

woss opened this issue · 3 comments

woss commented

Hi guys,

I have strange situation, when i installed this plugin i got highlighted lines only for twig, not html.
Is it a bug or feature? :)

thanks

Hi,
It should highlight html if you use the *.html.twig filename convention.

You can check filetype by using :se ft?

It should say htmltwig if you want the HTML highlighting to work as expected.

If you use a different naming convention, you can set this manually with :se ft=htmltwig

I'm not actively using this anymore since I've switched to Python for most of my development.

Hope that helps,
Gabriel

I get the same error here, but when I move *.twig detection before *.html.twig in ftdetect/twig.vim, HTML is correctly highlighted. But snippets don't work in that case... :(

I've changed the declared filetype to html.twig (from htmltwig) which is more in line with how other bundles handle filetypes. This makes anything HTML work as expected (though this may have unintended consequences if people were differentiating htmltwig from plain html for any settings.