-
Notifications
You must be signed in to change notification settings - Fork 73
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
support for jinja2? #83
Comments
What is the file type you are using? Do you use any jinja2 plugin? |
I don't believe there is an official file extension, but from what I've seen .j2 .jinja and .jinja2 are widely accepted I do have the following set: Other than that I'm currently just using a pretty minimal setup of nvim with deoplete, but I don't think deoplete or deoplete-jedi has any affect on jinja files. |
Should be possible to define a set of regexes for the jinja tags, like au FileType jinja let b:match_words = get(b:, 'match_words', '')
\ . ',{%-\?\s*if.\{-}-\?%}:{%-\?\s*else\s*-\?%}:{%-\?*\s*endif\s*-\?%}'
\ . ',{%-\?\s*for.\{-}-\?%}:{%-\?\s*endfor\s*-\?%}' Supporting this in general is hard because it depends on the underlying filetype- I guess usually it is html (e.g., https://github.com/Glench/Vim-Jinja2-Syntax/), but in your case you don't seem to have an html document filetype at all. |
I opened an issue for that plugin (Glench/Vim-Jinja2-Syntax#29) , but actually I it may be related to Match-up. For the moment, Vim-Jinja2-Syntax does not match multi-line statements: {% for very_long in dict
if true and not false %}
[...]
{% endfor %} I tried to fix that by just adding let b:match_words = '<:>,' .
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>,' .
\ '{%[-+]\? *\%(end\)\@!\(\w\+\)\>\_.\{-}%}:{%-\? *end\1\>.\{-}%}' Here is the error I get when the cursor hits
(Sorry if this should go in its own issue) |
Could we get support for jinja2?
For:
{% if %} {% else %} {% endif %}
{% for %} {% endfor %}
etc.
Related to #68 since jinja2 originates from python but imo shouldn't necessarily depend on python being supported.
The text was updated successfully, but these errors were encountered: