Search code examples
pythonsyntax-highlightinggeditsage

Is there a way to tell gedit that .sage files should always be highlighted as Python code?


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.


Solution

  • 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>