When working on web dev projects, we work with many file formats, some of which aren't recognised by Code, such as .twig.

Is there a way to add support for these?

If not, is there a way to treat all files with that extension as a particular language (eg. HTML)?

1 Answer 1


I really don't know

You should ask in their Github page


Maybe ask for this new feature or some info on where to write the syntax definition...



Thanks for the downvote, you made me learn a new thing. I followed my own suggestion and went to their Github page (as I said could be the best way to get an answer) and looked for people asking for new language support. Normal stuff right?. Found a post of a person asking for "Language Support for Ren'Py"


There, a person who has the know-how of 's environment, told him and us that uses gtksourceview

So I went to the old Google, searched for "twig gtksourceview" and found this:

https://twig.symfony.com/doc/2.x/templates.html (I believe this is the Official website of the language?)

If we look for gtksourceview we find


,that leads us to:



To add support to others just repeat:

  1. Go to the official website and look for their gtksourceview template format file, if they don't have a template made, look for it in Google and if all goes wrong you just can edit/create one yourself. (see below for format definition)

  2. Create it or download it

  3. Save it in your system where it should (see below)

  4. Profit

Where to save it?







  • 1
    So to clarify, we're looking for a [languagename].lang file? Thanks for investigating this! Commented Dec 1, 2018 at 13:10
  • Not exactly [languagename].lang. But in some cases it may be that way. Just explore that directory and there you can find the HTML file in case you don't any solution for the other types you talked so you can copy that or add the extension.
    – Sebastian
    Commented Dec 2, 2018 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.