Skip to content

Conversation

@yujinyuz
Copy link

Every time I open an html file in a Django project, it always sets the filetype to html.

This fixes that problem

@sheerun
Copy link
Owner

sheerun commented Sep 23, 2020

would jinja.html filetype work for you as well?

sheerun added a commit that referenced this pull request Sep 23, 2020
@sheerun
Copy link
Owner

sheerun commented Sep 23, 2020

I think this should be fixed now, could you check?

@yujinyuz
Copy link
Author

@sheerun I'm getting incorrect syntax highlighting when using jinja.html

set ft=jinja.html
Screen Shot 2020-09-24 at 10 33 43 AM

set ft=htmldjango
Screen Shot 2020-09-24 at 10 33 56 AM

When vim-polyglot is not installed, htmldjango is detected properly because vim/neovim supports htmldjango by default. The source in neovim isdist#ft#FThtml(). which automatically sets the file to htmldjango. Seems like polyglot is intervening with that, so a supposed htmldjango file is reverted back to plain html because of polyglot

@sheerun sheerun closed this in e2bbed8 Sep 24, 2020
@sheerun
Copy link
Owner

sheerun commented Sep 24, 2020

@yujinyuz Thank you for all the feedback. I've removed lepture/vim-jinja from vim-polyglot and replaced it with vim-native htmldjango syntax files. I hope it works for you now

@yujinyuz
Copy link
Author

Thanks @sheerun

It works perfectly now 😸

@yujinyuz yujinyuz deleted the fix/ftdetection-htmldjango branch September 24, 2020 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants