Glench / Vim-Jinja2-Syntax

An up-to-date jinja2 syntax file.
https://github.com/mitsuhiko/jinja2
BSD 3-Clause "New" or "Revised" License
343 stars 64 forks source link

Auto indent everything inside of jinja template tags. #10

Closed MaicoTimmerman closed 4 years ago

MaicoTimmerman commented 8 years ago

Code from Steve Losh steve@stevelosh.com.

This combined the highlighting of this nice plugin with the perfect autoindenting. This gives '=' the ability to create perfect indented code.

Herz3h commented 4 years ago

Will this be merged any time soon ? I find indentation to not be working properly for template files when I do gg=G

Glench commented 4 years ago

@Herz3h can you send me an example file?

Herz3h commented 4 years ago

here is an example:


{% for test in test %}
{% if test is defined %}
test is defined
{% else %}
{% for subtest in test %}
<div>{{ subtest.value }}</div>
{% endfor %}
{% endif %}
{% endfor %}
Glench commented 4 years ago

@Herz3h thanks! I manually merged this pull request after I verified the issue and fix.

Herz3h commented 4 years ago

Thank you, will check this tomorrow at work 👍

Herz3h commented 4 years ago

I have tested it, it works fine. Only weird thing is that when I set filetype to jinja, every word is syntax highlighted as red..is this normal ?

Glench commented 4 years ago

was that happening before? do you have other configs going on?

Herz3h commented 4 years ago

I was using vim plmolyglot for the twig syntax highlighting before, now that I use this plugin, everything is red colored

Glench commented 4 years ago

works ok for me on an install with no other plugins enabled. we'll see if other folks have issues