villadistribution.blogg.se

Gedit syntax highlighting
Gedit syntax highlighting











Will update the image when I get a chance. Moving the "class-name" section (my code above) to below the "keywords" section that already exists, fixes this as it moves our change lower in the hierarchy.

#Gedit syntax highlighting install#

The benefit of reusing an existing style rather than defining a new one for class names is that it will work for all of the gedit themes you install in future - they don't need to be altered to add a python-specific function name section.Īs noted in the comments, this nukes the styling on "def". You can change the map-to line at the top of the language file to change the style applied to your function names. Save that, then restart gedit and the function name should be styled the same as an error, e.g. If this attribute is "true", then the highlighting style will be applied to the area between start and end matches otherwise whole context will be highlighted. You need the style-inside="true" to not apply styling to the def or ( that we match on.

gedit syntax highlighting

You then need to add a new context to this file under the You first need to add a style for the style id you're going to create: The language definition is python.lang and for me is in /usr/share/gtksourceview-2.0/language-specs. I had to write a syntax spec a while ago for a language called Frege.

gedit syntax highlighting

6,591 12 12 gold badges 47 47 silver badges 64 64 bronze badges. You need to edit the language definition file to add a new section. syntax-highlighting gedit language-specifications Share. I thought might do it, but it seems have no effect in gedit. I've searched through but I couldn't find anything. I'm trying to tweak a gedit style so that user-defined functions have a different colour.











Gedit syntax highlighting