Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-HTML mustache #96

Open
Mange opened this issue Sep 11, 2019 · 2 comments
Open

Non-HTML mustache #96

Mange opened this issue Sep 11, 2019 · 2 comments

Comments

@Mange
Copy link

Mange commented Sep 11, 2019

I have some nginx config files using mustache for pre-processing, but this applies to any sort of file.

If I open, for example, a foo.json.mustache, then the filetype is set to html.mustache instead of json.mustache.

I'm trying to fix some of this via my own config, but since the au uses set filetype instead of setfiletype this plugin overrides my own ftdetect declarations.[1]

Can I solve this somehow?

Here's a snippet from my ftdetect/nginx.vim:

au BufRead,BufNewFile */nginx/conf.d/*.conf set ft=nginx
au BufRead,BufNewFile */nginx/conf.d/*.conf.mustache set ft=nginx.mustache syntax=mustache

[1]: At least I think this is the issue; I don't know how to really confirm it. If I source the ftdetect/nginx.vim file and reload the example file, then the detection works. But during normal startup it has no effect, despite showing up in the :au output. This is why I suspect it's an ordering problem.

@jsit
Copy link
Contributor

jsit commented Aug 8, 2020

Try putting your set filetype lines into ~/.vim/after/ftplugin/nginx.vim instead; that should cause them to fire after this plugin.

@Mange
Copy link
Author

Mange commented Aug 10, 2020

Thank you. I will try this!

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

No branches or pull requests

2 participants