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.

TRiG
  • 1,960
  • 2
  • 18
  • 39

1 Answers1

4

Yes you can go to

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

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