2

Well, that's about all there is to say. Currently I have to set the highlighting on each file by hand, which is getting annoying, especially since it sometimes forgets and I have to set it again.

I'm using gedit 3.6.1 on a lubuntu machine, if that matters.

Sorry if this is a really easy question, but I haven't been able to figure it out myself. Thanks.

Oliver
  • 211
  • 1
  • 7
  • perhaps you can find some inspiration in the links provided here http://stackoverflow.com/questions/766775/creating-your-own-syntax-highlighting-in-gedit – Fredrik Pihl Jun 14 '13 at 19:35

1 Answers1

5

Thanks to Fredrik's comment I found an easy solution, although it seems like more of a hack than one would want.

go to

/usr/share/gtksourceview-3.0/language-specs/python.lang

and edit line 30 to say

<property name="globs">*.py;*.sage</property> 

instead of

 <property name="globs">*.py</property>
Oliver
  • 211
  • 1
  • 7
  • 1
    A bit late, but for the record, you can also copy `/usr/share/gtksourceview-3.0/language-specs/python.lang` to `~/local/share/gtksourceview-3.0/language-specs/sage.lang` and replace `*.py` by `*.sage` in the same manner. It's a bit less hacky. It also allows you to customize the highlighting specifically for Sage. – yori Oct 05 '14 at 09:03
  • @yyzz It's never too late. This is a sound fork candidate. – mckenzm Feb 13 '19 at 01:55
  • @yori FYI I had to use `~/.local` instead of `~/local` to make your tip work. – Forrest Voight Jun 10 '21 at 02:16