【发布时间】:2010-11-08 12:45:51
【问题描述】:
我正在尝试调整 gedit 样式,以便用户定义的函数具有不同的颜色。
我搜索了http://library.gnome.org/devel/gtksourceview-2.0/stable/lang-reference.html,但找不到任何东西。
我认为<style name="def:function" /> 可能会这样做,但在 gedit 中似乎没有效果。
<?xml version="1.0" ?>
<style-scheme id="wombat" name="Wombat" version="1.0">
<author/>
<_description>Wombat theme</_description>
<style background="#2d2d2d" name="current-line"/>
<style background="#857b6f" bold="true" foreground="#fff000" name="bracket-match"/>
<style background="#242424" bold="true" foreground="#fff000" name="search-match"/>
<style background="#656565" name="cursor"/>
<style background="#242424" foreground="#f6f3e8" name="text"/>
<style background="#272727" foreground="#857b6f" name="line-numbers"/>
<style foreground="#363636" italic="true" name="def:comment"/>
<style foreground="#e5786d" name="def:constant"/>
<style foreground="#95e454" italic="true" name="def:string"/>
<style foreground="#cae682" name="def:identifier"/>
<style foreground="#000000" name="def:function"/>
<style foreground="#cae682" name="def:type"/>
<style foreground="#8ac6f2" name="def:statement"/>
<style foreground="#8ac6f2" name="def:keyword"/>
<style foreground="#e5786d" name="def:preprocessor"/>
<style foreground="#e5786d" name="def:number"/>
<style foreground="#e7f6da" name="def:specials"/>
</style-scheme>
有什么提示吗?谢谢!
【问题讨论】:
-
您希望
def foo(a,b,c):中的foo以不同的颜色突出显示吗?这是我的理解,也是我所追求的。 -
我刚刚注意到我假设您使用的是 Python。我敢肯定,无论您尝试使用哪种语言,您都可以提出类似的规则。
标签: linux gtk syntax-highlighting gedit