zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
25.18k stars 1.18k forks source link

No syntax highlighting in .jinja/.j2 files #2137

Open moonburnt opened 3 years ago

moonburnt commented 3 years ago

Description of the problem or steps to reproduce

Jinja documentation recommends adding .jinja extension to its templates (e.g instead of template.html, file would be template.html.jinja). And previously .j2 was used for the same purpose. However, after doing any of these, micro loses ability to highlight syntax in related files

Specifications

Commit hash: 6bc498e6 OS: Manjaro Linux Terminal: rxvt-unicode

dustdfg commented 7 months ago

Just formally micro has syntax highlighting for it https://github.com/zyedidia/micro/blob/master/runtime/syntax/jinja2.yaml

And it can be resolved by adding there:

detect:
    filename: "(\\.jinja$|\\.j2$)"

At least I think it should work