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

送分小仙女□ 提交于 2019-12-11 02:27:19

问题


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.


回答1:


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>


来源:https://stackoverflow.com/questions/17115873/is-there-a-way-to-tell-gedit-that-sage-files-should-always-be-highlighted-as-py

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!