LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Custom syntax highlighting on Gedit (https://www.linuxquestions.org/questions/linux-software-2/custom-syntax-highlighting-on-gedit-947127/)

fortore 05-27-2012 12:09 PM

Custom syntax highlighting on Gedit
 
I want the plus signs (+) to be highlighted everywere in the text. How does the .lang-file have to look like? The name for this highlight should be 'ABC' and it includes all '.abc'-files.

I tried to start like this (a lot of it is just copied and has to be customized but I do not know how):

Code:

<?xml version="1.0" encoding="UTF-8"?>
<language id="abc" _name="ABC" version="2.0" _section="Markup">
  <metadata>
<property name="mimetypes">text/plain</property>
<property name="globs">*.abc</property>
  </metadata>
  <styles>
<style id="indent2" _name="2x indented"  map-to="def:headword" />
  </styles>

  <definitions>
    <context id="headword" style-ref="comment" class="comment" class-disabled="no-spell-check">
  <start>+</start>
      <include>
        <context ref="def:headword"/>
      </include>
    </context>
  </definitions>
</language>


amani 05-28-2012 08:58 PM

https://live.gnome.org/Gedit/NewLanguage
This page tells you how to do it:
http://developer.gnome.org/gtksource...-tutorial.html
(simple regex)


All times are GMT -5. The time now is 11:57 PM.