4

For some godforsaken reason, Twig files in our source code are saved with a .html extension, instead of a .twig extension. I followed guidelines to add custom highlighting to Gedit, and the Twig highlighter I found does attach to .html files (with <property name="globs">*.twig;*.html;</property>). However, the inbuilt HTML highlighter also attaches to .html files (with <property name="globs">*.html;*.htm</property>). This is the ruleset that Gedit uses for .html files (possibly because html.lang is earlier alphabetically than twig.lang).

I don’t often edit either HTML or Twig, so I don’t need some sort of automated solution which works out what type of file it really is and applies the correct highlighting. Picking the highlighting from a Preferences menu would be sufficient. Is there any way to do that?

Basically, when I open a .html file, I want a way to tell Gedit that this file is actually Twig.

1

1 Answer 1

4

Yes you can go to

View -> Highlight mode -> Select which one you need

2
  • Heh. I was searching under Tools and under Edit → Preferences. Never occurred to me to look at View. Thanks.
    – TRiG
    Commented May 17, 2017 at 11:55
  • I've actually found that it's also in the status bar at the bottom of the window.
    – TRiG
    Commented Jul 25, 2017 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .