evidens/vim-twig

b:main_syntax set to htmldjango

Closed this issue · 3 comments

In #13 @ecoleman wrote:

Since both of the "broken highlighting" tickets are still open, I'll comment here..

A fresh install of latest vim + this plugin results in HTML not being highlighted.. It appears that b:main_syntax is set and is equal to htmldjango, not sure why that happens

I would guess you have another plugin that supports django templates and might have twig support because they're vaguely similar.

If you look at https://github.com/evidens/vim-twig/blob/master/syntax/twig.vim#L20, notice it will bail out if the b:main_syntax is already set.

Fix the other plugin not to detect .twig (or at least try deactivating) and it should be fine.

I'm closing this issue since I am discontinuing support for this repo.

Adding this line to one's .vimrc prevents vim from interpreting the file type as htmldjango:

let g:ft_ignore_pat='\.\(Z\|gz\|bz2\|zip\|twig\|tgz\)$'

For more details: http://vimdoc.sourceforge.net/htmldoc/filetype.html