samuelcolvin / jinjahtml-vscode

Syntax highlighting for jinja(2) html templates in vscode
https://marketplace.visualstudio.com/items?itemName=samuelcolvin.jinjahtml
MIT License
135 stars 53 forks source link

Auto close Jinja template curly-brace percent-sign tags #69

Closed kadac00 closed 4 years ago

kadac00 commented 4 years ago

When I am editing an HTML file containing Jinja tags in Visual Studio Code, if I type the opening curly-brace percent-sign tag {%, I would like it to go ahead and add the closing curly-brace percent-sign tag %}. Is there a way that I can add these tags to the configuration for Visual Studio Code?

Ideally, when I type {% it should add the %} and add spaces between them so the cursor would look like {% | %}

samuelcolvin commented 4 years ago

It's remotely possible this can be solved with snippets, see https://github.com/samuelcolvin/jinjahtml-vscode/blob/master/snippets/django-snippets.json.

If that doesn't work, there might be another way or it might be a limitation of vscode.

You would need to do some research and submit a pr if you find a way.